Beginner

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

Color preview
#3B82F6
HEX code
#3B82F6
14%
30%
57%
R 59
G 130
B 246
Red / Green / Blue channel contribution (0–255 each)
HSL
hsl(217, 91%, 60%)
HSV
hsv(217, 76%, 96%)
CMYK
cmyk(76%, 47%, 0%, 4%)
Hue
217°
Saturation (HSL)
91%
Lightness
60%
Saturation (HSV)
76%
Value (V)
96%
Step by step
  1. 1

    Normalise channels (÷ 255)

    R=0,2314, G=0,5098, B=0,9647
    Divide each 8-bit channel by 255 to map it to the [0, 1] range
  2. 2

    Max / min / delta

    max=0,9647, min=0,2314, delta=0,7333
  3. 3

    HSL Lightness

    (0,9647 + 0,2314) ÷ 2 = 60
  4. 4

    HSL Saturation

    0,7333 ÷ (1 − |2×0,598 − 1|) = 91
Rezultati su procjene namijenjene isključivo općoj informaciji i ne predstavljaju stručni savjet — uvijek samostalno provjerite važne rezultate prije nego što se na njih oslonite. Pročitajte cijelu izjavu o odricanju odgovornosti.
Brzi odgovor

Kako radi ovaj kalkulator?

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.

Formula
HEX = #RRGGBB (base-16) • HSL: L=(max+min)/2, S=(max−min)/(1−|2L−1|) • HSV: V=max, S=(max−min)/max • CMYK: K=1−max, C=(1−R−K)/(1−K)
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.

Često postavljana pitanja

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.

Poznato i kao

rgb to hex converter
rgb to hsl converter
rgb to hsv converter
rgb to cmyk converter
color code converter
hex color picker
hsl color calculator

APA

TG we-Calculate Editorial Team. (2026). Color Converter — RGB to HEX, HSL, HSV & CMYK [Online calculator]. TG we-Calculate. https://we-calculate.com/hr/calculator/color-converter

Chicago

TG we-Calculate Editorial Team. "Color Converter — RGB to HEX, HSL, HSV & CMYK." TG we-Calculate. 2026. https://we-calculate.com/hr/calculator/color-converter.

IEEE

TG we-Calculate Editorial Team, "Color Converter — RGB to HEX, HSL, HSV & CMYK," TG we-Calculate, 2026. [Online]. Available: https://we-calculate.com/hr/calculator/color-converter

BibTeX

@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/hr/calculator/color-converter}}, year = {2026}, note = {TG we-Calculate} }

Je li vam ovaj kalkulator pomogao?