Color3ToHex - Styxling/Feather GitHub Wiki

This module converts a Color3 value to a hexadecimal color string.

What It Does

  • Input: A Color3 value (with red, green, and blue components between 0 and 1).
  • Output: A hexadecimal string formatted as #RRGGBB.

For example, a Color3 value of (1, 0, 0) returns #FF0000.

Usage Example

Color3ToHex is located in the Replicated subfolder. To load the module:

local Directory = require(ServerStorage.Directory.MainModule)
local ColorToHex = Directory("_replicated", "Color3ToHex")

local hexString = ColorToHex(Color3.new(1, 0, 0))
print(hexString)  -- Output: "#FF0000"