Color Converter — RGB to HEX, HSL, HSV & CMYK
Enter red, green and blue values (0–255 each) to instantly get the HEX code, HSL, HSV and CMYK equivalents — and see a live colour swatch.
0–255
0–255
0–255
#3B82F6
- 1
Normalise channels (÷ 255)
R=0,2314, G=0,5098, B=0,9647Divide each 8-bit channel by 255 to map it to the [0, 1] range - 2
Max / min / delta
max=0,9647, min=0,2314, delta=0,7333 - 3
HSL Lightness
(0,9647 + 0,2314) ÷ 2 = 60 - 4
HSL Saturation
0,7333 ÷ (1 − |2×0,598 − 1|) = 91
Hvordan fungerer denne lommeregner?
RGB → HEX: write each channel as two hex digits. RGB → HSL: Lightness = (max+min)/2 of normalised channels; Saturation = spread adjusted for lightness; Hue from dominant channel. RGB → CMYK: K = 1 − max; each CMY = (1 − channel − K) ÷ (1 − K). All conversions are exact for the 0–255 integer range.
Formel
How this is calculated
RGB (Red, Green, Blue) is the additive colour model used by screens. Each channel runs from 0 (none) to 255 (full), giving over 16 million possible colours. To convert to HEX, each channel is simply written as a two-digit base-16 number and concatenated: R=59, G=130, B=246 becomes #3B82F6.
HSL (Hue, Saturation, Lightness) and HSV (Hue, Saturation, Value/Brightness) are cylindrical models designed to be more intuitive for humans to manipulate. Both share the same hue calculation: normalise R, G, B to 0–1, find the maximum and minimum channel values, then derive hue from which channel is dominant and by how much. Lightness in HSL is the average of max and min; saturation adjusts for that lightness. In HSV, Value equals the max channel directly, and saturation is the relative spread between max and min. HSL is common in CSS; HSV is common in design tools.
CMYK (Cyan, Magenta, Yellow, Key/Black) is the subtractive model used in print. The black (K) component is derived first as 1 minus the largest normalised channel, then each CMY channel is derived from the remaining RGB fraction after removing the black component. Note that screen-to-print conversion via CMYK is an approximation — professional print workflows use ICC colour profiles for accuracy.
Ofte stillede spørgsmål
Both use the same hue, but they define the "brightness" axis differently. HSL Lightness = 50% for a pure saturated colour, 0% for black and 100% for white. HSV Value = 100% for both pure saturated colours and white, 0% only for black. HSL is more symmetrical; HSV maps more closely to how artists think about adding black or white to a colour.
The formula gives a mathematical CMYK equivalent, but practical printing uses ink profiles that differ from display RGB. The conversion is accurate enough for web-to-print estimates, but professional print work should use application colour management with ICC profiles.
Hue describes the colour's angle on the colour wheel (red at 0°, green at 120°, blue at 240°) and depends only on which RGB channel dominates and by how much — a property shared by both models. Only the saturation and brightness axes differ.
Også kendt som
TG we-Calculate Editorial Team. (2026). Color Converter — RGB to HEX, HSL, HSV & CMYK [Online calculator]. TG we-Calculate. https://we-calculate.com/da/calculator/color-converter
TG we-Calculate Editorial Team. "Color Converter — RGB to HEX, HSL, HSV & CMYK." TG we-Calculate. 2026. https://we-calculate.com/da/calculator/color-converter.
TG we-Calculate Editorial Team, "Color Converter — RGB to HEX, HSL, HSV & CMYK," TG we-Calculate, 2026. [Online]. Available: https://we-calculate.com/da/calculator/color-converter
@misc{wecalculate_color_converter, title = {Color Converter — RGB to HEX, HSL, HSV & CMYK}, author = {{TG we-Calculate Editorial Team}}, howpublished = {\url{https://we-calculate.com/da/calculator/color-converter}}, year = {2026}, note = {TG we-Calculate} }
Hjalp denne lommeregner dig?
