Color Converter (HEX ↔ RGB ↔ HSL)
Color Converter (HEX ↔ RGB ↔ HSL) is evaluated from Red, Green and Blue. The calculation reports HEX, RGB and Hue.
Results
About the Color Converter (HEX ↔ RGB ↔ HSL)
The calculator uses a multi formula configuration. Each reported value is read as a direct evaluation of the stored rules with the declared field formats and units.
Formula basis:
HEX: convert each R/G/B value to 2-char hex string
HSL: derive hue (0-360 deg), saturation (0-100%), lightness (0-100%) from normalized RGB
Interpret the outputs in the order shown by the result fields. Optional inputs affect only the outputs that depend on those variables.
Formula & How It Works
The calculation applies the following relations exactly as recorded in the metadata: HEX: convert each R/G/B value to 2-char hex string HSL: derive hue (0-360 deg), saturation (0-100%), lightness (0-100%) from normalized RGB Each output field is produced by substituting the supplied inputs into the relevant relation and then applying the declared rounding or text format.
Worked Examples
Example 1: Pure red: RGB(255, 0, 0)
Inputs
With Red = 255, Green = 0 and Blue = 0 as the stated inputs, the result is HEX = #FF0000, RGB = rgb(255, 0, 0) and Hue = 0 deg. Each value corresponds to the declared output fields.
Example 2: Tailwind CSS blue-500: RGB(59, 130, 246)
Inputs
With Red = 59, Green = 130 and Blue = 246 as the stated inputs, the result is HEX = #3B82F6, RGB = rgb(59, 130, 246) and Hue = 217.2 deg. Each value corresponds to the declared output fields.
Example 3: Forest green: RGB(34, 139, 34)
Inputs
With Red = 34, Green = 139 and Blue = 34 as the stated inputs, the result is HEX = #228B22, RGB = rgb(34, 139, 34) and Hue = 120 deg. Each value corresponds to the declared output fields.
Example 4: Pure white: RGB(255, 255, 255)
Inputs
With Red = 255, Green = 255 and Blue = 255 as the stated inputs, the result is HEX = #FFFFFF, RGB = rgb(255, 255, 255) and Hue = 0 deg. Each value corresponds to the declared output fields.
Common Use Cases
- Convert HEX color to RGB for CSS
- Find HSL values for web design
- Convert colors between design software formats