
Methodology
Color conversion, color spaces, and rounding
Hue Codex converts accepted color input into one resolved sRGB fallback for shared tool logic, while conversion tools also report the authored source value when it differs from that fallback.
Short answer
Hue Codex distinguishes the authored input from its resolved sRGB fallback. Supported tools preserve authored syntax and alpha for swatches, sharing, and alpha-capable exports; calculations that require opaque colors identify and use a rendered composite. Display precision changes what users see, not the internal math used for decisions.
- Accepted colors retain alpha and authored source metadata alongside a resolved sRGB fallback; each downstream tool declares whether it preserves, transforms, or composites that alpha.
- Authored Lab/LCH/OKLab/OKLCH values are preserved as source metadata in conversion and gamut messaging, not as the canonical value for every downstream calculation.
- HSL, HSV, and HWB are RGB-derived models; Lab/LCH and OKLab/OKLCH are perceptual or device-independent views of the same resolved color.
- Lab and LCH use D50 Lab after adapting from sRGB D65 XYZ. OKLab and OKLCH use D65 XYZ.
- Out-of-range RGB results are clamped only when Hue Codex creates a display/export sRGB fallback; this is not perceptual gamut mapping.
Standards status
These badges identify which parts of this methodology are standards-backed, draft-track, source-origin references, Hue Codex-specific, approximate, or dependent on browser behavior.
Formulas, choices, heuristics, and limits
This separates standards-based formulas from Hue Codex implementation decisions, product heuristics, and known limitations for this methodology.
Standards-based formulas
Formula, threshold, syntax, or data behavior taken from a cited standard. Primary and model sources can inform implementation, but they are not automatically standards.
- CSS Color 4 color-space definitions, sRGB linearization, XYZ conversion context, and Lab/LCH or OKLab/OKLCH coordinate behavior.
- Stable CSS color syntax for HEX, rgb(), hsl(), hwb(), lab(), lch(), oklab(), and oklch() where supported by the tool.
- CSS Color 4 component scales and percentage reference ranges for RGB, XYZ, Lab/LCH, OKLab/OKLCH, and hue angles.
- CSS Color 4 powerless hue behavior for achromatic HSL/HWB colors and zero-chroma LCH/OKLCH polar colors.
Implementation choices
How Hue Codex chooses to parse, normalize, round, export, or sequence calculations.
- Hue Codex distinguishes authored input from the resolved fallback: supported concrete CSS source syntax and exact parsed alpha are preserved, while display/export fallbacks use resolved sRGB base channels and keep alpha separate or serialize it as eight-digit HEX when that output format requires 8-bit alpha.
- The typed parser accepts a documented CSS Color 4 subset and rejects context-dependent keywords or unsupported grammar instead of guessing an opaque fallback.
- Hue Codex displays RGB as 8-bit sRGB channels, uses 0-1 normalized channels for transfer functions, and reports XYZ on the relative scale where diffuse white has Y = 1.0.
- Channel clamping to displayable sRGB is a Hue Codex display/export fallback choice, not a perceptual gamut-mapping strategy.
- When a resolved fallback color is achromatic or below the CSS Color 4 powerless-hue threshold, Hue Codex applies a neutral/powerless hue policy. Current fallback serializers may use 0 as the neutral marker, but methodology text labels that hue non-authoritative rather than meaningful.
- Lab and LCH are calculated through D65 to D50 adaptation; OKLab and OKLCH use D65 XYZ.
- Precision modes affect output strings, while internal checks keep raw calculation values when thresholds matter.
Hue Codex heuristics
Product rankings, bands, labels, suggestions, or role hints that are useful guidance but not external standards.
- Compact, readable, token, and detailed precision presets are Hue Codex output choices.
- Fallback and summary wording are chosen to make handoff safer, not because a standard requires that exact wording.
Known limitations
Caveats, edge cases, browser dependencies, approximations, or contexts the method does not prove.
- Converting an out-of-gamut perceptual color back to sRGB can clamp channels and hide lost chroma.
- Clamped fallback values should not be used as proof that an out-of-gamut authored color has been perceptually mapped into sRGB.
- Once a zero-chroma or achromatic authored color has resolved to sRGB, downstream tools cannot infer a meaningful original hue from it.
- Browser rendering, color management, and unsupported notation can change what users actually see.
- CSS Color 5 references are draft context and should not be treated as final standards authority.
Representative automated fixture coverage
Hue Codex imports versioned JSON fixtures and tests the corresponding pure production functions directly. The groups below are the representative regression evidence most relevant to this methodology.
- Parsing fixtures: Accepted CSS color syntax, alpha behavior, clamping, invalid input, and out-of-gamut fallback cases. View the JSON fixtures.
- Conversion fixtures: sRGB, XYZ, Lab/LCH, OKLab/OKLCH conversion values, round trips, and precision boundaries. View the JSON fixtures.
What a pass means. A passing group confirms the named vectors and tested properties still match the documented implementation. It does not prove every possible input, final browser rendering, full accessibility conformance, profile-aware print output, or every downstream export consumer.
Inputs and parsing
Hue Codex accepts concrete CSS color notation, including short, long, and alpha HEX; fixed CSS named colors; transparent; rgb()/rgba(); hsl()/hsla(); hwb(); lab(); lch(); oklab(); oklch(); and supported color() profiles where a tool exposes typed input. Unsupported, contextual, or incomplete input is rejected instead of guessed.
Alpha values remain part of the parsed color. Swatches, share state, and alpha-capable exports preserve them; contrast calculations composite translucent colors over an identified canvas before applying thresholds.
CSS syntax parsing rules
CSS Color 4 defines a larger <color> grammar than Hue Codex uses for typed conversion. Hue Codex follows the distinction between modern space-separated syntax and legacy comma syntax, then narrows the accepted set to concrete values that can resolve without cascade, custom-property, system-theme, or element context.
Modern syntax uses whitespace between color components and a slash before alpha, such as rgb(65 105 225 / 50%) or oklch(55.98% 0.188 266.4). Legacy comma syntax is accepted only for rgb(), rgba(), hsl(), and hsla(). Commas in hwb(), lab(), lch(), oklab(), or oklch() are rejected.
Hue values accept unitless degrees plus deg, grad, rad, and turn angle units. Hue values are converted to degrees before conversion. The none keyword is not accepted in typed conversion, even though CSS Color 4 defines it for missing components, because Hue Codex resolves every typed input to a concrete fallback color.
Fixed CSS named colors, transparent, and supported color() profiles are accepted. Context-dependent values such as currentcolor, system colors, var(), relative color syntax, color-mix(), light-dark(), and unsupported keywords are rejected because a standalone field cannot resolve their cascade or environment.
| Syntax topic | Hue Codex behavior |
|---|---|
| HEX | Accepts #RGB, RGB, #RGBA, RGBA, #RRGGBB, RRGGBB, #RRGGBBAA, and RRGGBBAA; preserves alpha while exposing a six-digit opaque channel fallback |
| Legacy comma forms | Accepts rgb(), rgba(), hsl(), and hsla() with comma-separated components and comma alpha |
| Modern space forms | Accepts rgb(), rgba(), hsl(), hsla(), hwb(), lab(), lch(), oklab(), and oklch() with space-separated components and optional slash alpha |
| Slash alpha | Preserved in the parsed value, swatch, sharing, and alpha-capable output; opaque-only calculations explicitly composite or identify their base-channel behavior |
| Percentages vs numbers | RGB percentages map to 0-255 channels; HSL/HWB percentages use 0-100 reference units; Lab/LCH/OKLab/OKLCH percentages use the CSS Color 4 reference ranges for their model |
| Hue units | Accepts unitless degrees, deg, grad, rad, and turn; stores the converted degree value before hue normalization |
| none | Rejected for typed conversion; Hue Codex does not preserve missing components in resolved fallback colors |
| Named colors | Accepts the fixed CSS named-color keywords and resolves them deterministically; contextual system colors remain unsupported |
| transparent and currentcolor | transparent is accepted with zero alpha; currentcolor is rejected because it depends on the cascade |
| color() | Accepts supported concrete srgb, display-p3, xyz, xyz-d50, and xyz-d65 profiles; unsupported or contextual forms are rejected |
| Invalid input | Rejected with a validation error; Hue Codex does not guess from malformed functions, mixed unsupported separators, or unknown keywords |
Powerless hue and zero chroma
CSS Color 4 treats some hue components as powerless because the hue cannot affect the final color. In these achromatic cases the standard semantics treat hue as missing: HSL saturation at or below 0.001, HWB whiteness plus blackness at or above 99.999, LCH chroma at or below 0.0015, and OKLCH chroma at or below 0.000004.
Hue Codex typed conversion does not preserve CSS none or missing-hue markers in resolved fallback colors. When the resolved fallback is achromatic or below the polar chroma threshold, the methodology treats hue as neutral/powerless. Current derived fallback strings may serialize that neutral marker as 0, but that is not evidence that the authored neutral color had a meaningful red hue.
Palette, adjustment, and interpolation tools should therefore avoid inferring a source hue from grayscale or zero-chroma inputs. When a later workflow needs a hue, Hue Codex treats that as a product decision or seed fallback, not as standards-derived color information.
| Case | CSS Color 4 behavior | Hue Codex output behavior |
|---|---|---|
| hsl(120 0% 50%) | Hue is powerless because saturation is zero. | Resolves to #808080; derived HSL displays hsl(0 0% 50.196078%). |
| hwb(270 50% 50%) | Hue is powerless because whiteness plus blackness is at least 99.999. | Resolves to #808080; derived hue output is treated as non-authoritative. |
| lch(50% 0 270) | Hue is missing because C <= 0.0015. | Resolves to #777777; derived LCH hue displays as 0. |
| oklch(50% 0 270) | Hue is missing because C <= 0.000004. | Resolves to #636363; hue is labeled by the neutral/powerless policy, not the authored 270deg. |
| lab(50 0 0) or oklab(0.5 0 0) | Polar conversion produces zero chroma, so hue is missing in the corresponding LCH or OKLCH view. | Derived polar hue is non-authoritative after fallback conversion. |
Authored source versus resolved fallback
Canonical sRGB HEX means the resolved display fallback, not necessarily the full authored color. For sRGB-compatible input, the authored value and fallback describe the same color and only notation or rounding changes.
For Lab, LCH, OKLab, OKLCH, Display P3, or XYZ input outside sRGB, Hue Codex preserves the authored functional value for source reporting, capable-browser swatches, share state, gamut messaging, and alpha-capable exports. Tools whose math is defined only for sRGB use the separately labeled clipped fallback or a rendered composite rather than silently relabeling the authored coordinates.
That clipped fallback is a Hue Codex display/export decision: it produces a browser-safe value, but it is not a color-managed or perceptual gamut-mapping result.
Hue Codex is therefore not claiming that an out-of-gamut authored Lab or OKLCH value survives unchanged through every tool. The preserved authored value explains the source and the loss; the resolved fallback is what most downstream calculations operate on.
| Situation | Preserved as authored input | Used for downstream logic |
|---|---|---|
| #4169E1 or rgb(65 105 225) | Equivalent sRGB value; notation may be normalized | #4169E1 |
| In-gamut Lab/LCH/OKLab/OKLCH/P3/XYZ | Original functional value retained for source, swatch, sharing, and compatible exports | Equivalent resolved sRGB fallback where an sRGB-only calculation needs it |
| Out-of-gamut Lab/LCH/OKLab/OKLCH/P3/XYZ | Original functional value retained with clipping and gamut notes | Clipped displayable sRGB fallback where required; not perceptual gamut mapping |
| Input alpha | Preserved as an internal 0 to 1 value and in authored/share syntax | Retained by alpha-capable transformations; composited on an identified canvas before opaque contrast math |
Units and component ranges
Hue Codex labels component scales explicitly because CSS authored syntax, internal conversion math, and display cards do not all use the same units. These ranges describe the scale used for conversion and display; out-of-gamut or theoretically unbounded components can still occur before sRGB fallback clamping.
| Component | Unit or scale | Range/reference | Hue Codex handling |
|---|---|---|---|
| RGB display channels | 8-bit gamma-encoded sRGB integers | 0-255 per R, G, and B channel | HEX and rgb() cards use this scale; values are rounded and clamped for displayable sRGB. |
| RGB normalized channels | Gamma-encoded unit interval | 0-1 per channel; CSS color(srgb) maps 0% to 0 and 100% to 1 | Internal transfer functions divide 8-bit channels by 255 before linearization. |
| Linear sRGB | Linear-light unit interval for in-gamut sRGB | 0-1 per channel for in-gamut colors; conversion math can produce values outside this before clamping | Used for XYZ matrix multiplication, relative luminance, and contrast math. |
| XYZ D65 and XYZ D50 | Relative CIE XYZ coordinates | Scaled so diffuse white has Y = 1.0; X and Z follow the selected white point and are not fixed to 0-1 | Hue Codex displays XYZ on this relative scale, not 0-100 tristimulus notation. |
| Lab L | CIE L* lightness | 0-100; CSS percentages map 0% to 0 and 100% to 100 | Values outside the CSS lightness range are clamped at parsed-value time for lab() and lch() input. |
| Lab a and b | Unitless opponent axes | Signed and theoretically unbounded; CSS percentage reference is -100% = -125 and 100% = 125 | Displayed with the Lab/LCH precision preset. |
| LCH C | Unitless CIE chroma | Minimum useful value 0; theoretically unbounded; CSS percentage reference is 0% = 0 and 100% = 150 | Negative authored chroma is clamped to 0; C <= 0.0015 makes hue powerless. |
| OKLab L | Unitless OKLab lightness | 0-1; CSS percentages map 0% to 0 and 100% to 1 | Displayed as a percent in CSS-style OKLab and OKLCH output when that format expects percentages. |
| OKLab a and b | Unitless opponent axes | Signed and theoretically unbounded; CSS percentage reference is -100% = -0.4 and 100% = 0.4 | Practical authored values usually sit near +/-0.5, but the model is not hard-bounded there. |
| OKLCH C | Unitless OK chroma | Minimum useful value 0; theoretically unbounded but practical colors usually do not exceed 0.5; CSS percentage reference is 0% = 0 and 100% = 0.4 | Negative authored chroma is clamped to 0; C <= 0.000004 makes hue powerless. |
| Hue H | Angle in degrees after parsing | Canonical display normalizes to [0, 360); 360deg is equivalent to 0deg | Accepts unitless degrees plus deg, grad, rad, and turn; powerless hue displays as 0. |
| Alpha | Unit interval or percentage | 0-1 or 0%-100% | Detected and exported in alpha-aware tools; base conversion resolves opaque channels unless the tool explicitly composites or exports alpha. |
Conversion path
- HEX is normalized to six uppercase sRGB digits for the canonical display color.
- sRGB channels are linearized before XYZ, Lab, OKLab, luminance, or contrast math.
- XYZ D65 is derived from linear sRGB with the exact linear sRGB-to-XYZ D65 matrix listed below.
- Lab and LCH are calculated from D50 XYZ after linear Bradford chromatic adaptation from D65; reverse conversion uses the D50-to-D65 Bradford matrix.
- OKLab and OKLCH are calculated from D65 XYZ with the listed XYZ-to-LMS and LMS-to-OKLab matrices, then converted between Cartesian and polar forms for chroma and hue.
Precision and rounding
Hue Codex rounds display strings according to the selected precision mode. The rule is a maximum decimal-place rule: trailing zeroes are not padded because the shared round() helper returns numeric values before string interpolation.
Rounding is applied at output boundaries. Tool checks such as contrast pass/fail use the raw values from the calculation path whenever the threshold matters.
The Color Converter and Color Picker expose Quick, CSS, Precise, and Token modes. The internal rounded mode is an alias of Quick, and the internal tokens mode is an alias of Token.
One export-specific exception: the converted-color CSS variable block writes the HSL custom property with two decimal places for hue, saturation, and lightness even when another precision mode is selected; the format cards, JSON, token JSON, SCSS module, documentation summary, and all-format summary use the selected mode.
| Mode | Basic components | XYZ coordinates | Lab/LCH components | OK a/b or OK chroma |
|---|---|---|---|---|
| Quick | 2 | 6 | 4 | 6 |
| CSS | 2 | 5 | 3 | 5 |
| Precise | 4 | 8 | 6 | 8 |
| Token | 3 | 7 | 5 | 7 |
Precision by output model
| Output | Precision rule |
|---|---|
| HEX | Always six uppercase sRGB HEX digits; no decimal precision |
| RGB | Integer 8-bit sRGB channels; no decimal precision |
| HSL, HSV, HWB | Hue and percentage-like components use the Basic component places for the selected mode |
| XYZ | X, Y, and Z use the XYZ coordinate places for the selected mode |
| Lab | L, a, and b use the Lab/LCH component places for the selected mode |
| LCH | L, C, and H use the Lab/LCH component places for the selected mode |
| OKLab | L percent uses the Lab/LCH component places; a and b use the OK places |
| OKLCH | L percent and H use the Lab/LCH component places; C uses the OK places |
Display and export clamping
When a perceptual or device-independent value converts back to sRGB for Hue Codex display cards, HEX/RGB copying, or fallback exports, output channels are clipped to the 0 to 255 display range. This makes a browser-safe fallback, but it can hide lost chroma or hue detail from the authored color.
This clamping is not a full perceptual gamut-mapping strategy. Hue Codex does not run a color appearance model, ICC profile transform, rendering intent, MINDE-style OKLCH search, or press-proof workflow on the Color Conversion page.
The gamut methodology page explains why this is different from profile-aware color management or print proofing.
Validation checks
| Input | Expected normalized behavior | Reason |
|---|---|---|
| #fff | #FFFFFF | Three-digit HEX expands channel pairs |
| #4169E1 | rgb(65 105 225) | Royal-blue sRGB channel values |
| hsl(0 0% 100%) | #FFFFFF | Neutral white in HSL resolves to white |
| rgb(255 0 0 / 0) | #FF0000 plus alpha caveat | Transparent red input shows the opaque red base color and warns that alpha was detected |
| hsl(120 0% 50%) | #808080 with derived hue 0 | Saturation is zero, so the authored hue is powerless |
| oklch(50% 0 270) | #636363 with neutral/powerless hue policy | Chroma is zero, so the authored 270deg hue is missing/non-authoritative |
| oklch values outside sRGB | Clipped sRGB fallback for display/export | Hue Codex fallback clamping is not perceptual gamut mapping |
Conversion equations
Hue Codex normalizes to sRGB HEX first, then derives the requested color-space views. These equations list the transfer functions, matrices, adaptation steps, and polar conversions used for sRGB, XYZ, D50 Lab/LCH, and D65 OKLab/OKLCH.
# Inputs r8, g8, and b8 are encoded sRGB channels in [0, 255].
srgb_to_linear(c8):
v = c8 / 255
if v <= 0.04045: return v / 12.92
return ((v + 0.055) / 1.055) ^ 2.4
linear_to_srgb_channel(c):
if c <= 0.0031308:
encoded = 12.92 * c
else:
encoded = 1.055 * (c ^ (1 / 2.4)) - 0.055
return round(clamp(encoded, 0, 1) * 255)
M_srgb_to_xyz_d65 = [
[506752/1228815, 87881/245763, 12673/70218],
[87098/409605, 175762/245763, 12673/175545],
[7918/409605, 87881/737289, 1001167/1053270],
]
M_xyz_d65_to_srgb_linear = [
[12831/3959, -329/214, -1974/3959],
[-851781/878810, 1648619/878810, 36519/878810],
[705/12673, -2585/12673, 705/667],
]
rgb_to_xyz_d65(r8, g8, b8):
rgb_linear = [srgb_to_linear(r8), srgb_to_linear(g8), srgb_to_linear(b8)]
return M_srgb_to_xyz_d65 * rgb_linear
xyz_d65_to_rgb(X, Y, Z):
rgb_linear = M_xyz_d65_to_srgb_linear * [X, Y, Z]
return [
linear_to_srgb_channel(rgb_linear[0]),
linear_to_srgb_channel(rgb_linear[1]),
linear_to_srgb_channel(rgb_linear[2]),
]
D50 = [0.3457/0.3585, 1, (1 - 0.3457 - 0.3585)/0.3585]
D65 = [0.3127/0.3290, 1, (1 - 0.3127 - 0.3290)/0.3290]
M_d65_to_d50 = [
[1.0479297925449969, 0.022946870601609652, -0.05019226628920524],
[0.02962780877005599, 0.9904344267538799, -0.017073799063418826],
[-0.009243040646204504, 0.015055191490298152, 0.7518742814281371],
]
M_d50_to_d65 = [
[0.955473421488075, -0.02309845494876471, 0.06325924320057072],
[-0.0283697093338637, 1.0099953980813041, 0.021041441191917323],
[0.012314014864481998, -0.020507649298898964, 1.330365926242124],
]
xyz_d65_to_d50(X, Y, Z):
return M_d65_to_d50 * [X, Y, Z]
xyz_d50_to_d65(X, Y, Z):
return M_d50_to_d65 * [X, Y, Z]
xyz_d50_to_lab(X, Y, Z):
Xn, Yn, Zn = D50
epsilon = 216/24389
kappa = 24389/27
f(t) = t > epsilon ? cbrt(t) : (kappa*t + 16)/116
fx = f(X / Xn)
fy = f(Y / Yn)
fz = f(Z / Zn)
L = 116*fy - 16
a = 500*(fx - fy)
b = 200*(fy - fz)
return L, a, b
lab_to_xyz_d50(L, a, b):
Xn, Yn, Zn = D50
epsilon = 216/24389
kappa = 24389/27
fy = (L + 16)/116
fx = a/500 + fy
fz = fy - b/200
finv(f) = (f^3 > epsilon) ? f^3 : (116*f - 16)/kappa
return [Xn*finv(fx), Yn*finv(fy), Zn*finv(fz)]
lab_to_lch(L, a, b):
C = sqrt(a*a + b*b)
if C <= 0.0015:
H_standard = missing
H_display = 0
else:
H_standard = normalize_degrees(atan2(b, a) * 180 / pi)
H_display = H_standard
return L, C, H_display
lch_to_lab(L, C, H):
if H is missing: return [L, 0, 0]
return [L, C*cos(H*pi/180), C*sin(H*pi/180)]
M_xyz_d65_to_lms = [
[0.8190224379967030, 0.3619062600528904, -0.1288737815209879],
[0.0329836539323885, 0.9292868615863434, 0.0361446663506424],
[0.0481771893596242, 0.2642395317527308, 0.6335478284694309],
]
M_lms_to_oklab = [
[0.2104542683093140, 0.7936177747023054, -0.0040720430116193],
[1.9779985324311684, -2.4285922420485799, 0.4505937096174110],
[0.0259040424655478, 0.7827717124575296, -0.8086757549230774],
]
M_oklab_to_lms_prime = [
[1.0000000000000000, 0.3963377773761749, 0.2158037573099136],
[1.0000000000000000, -0.1055613458156586, -0.0638541728258133],
[1.0000000000000000, -0.0894841775298119, -1.2914855480194092],
]
M_lms_to_xyz_d65 = [
[1.2268798758459243, -0.5578149944602171, 0.2813910456659647],
[-0.0405757452148008, 1.1122868032803170, -0.0717110580655164],
[-0.0763729366746601, -0.4214933324022432, 1.5869240198367816],
]
xyz_d65_to_oklab(X, Y, Z):
lms = M_xyz_d65_to_lms * [X, Y, Z]
lms_prime = [cbrt(lms[0]), cbrt(lms[1]), cbrt(lms[2])]
return M_lms_to_oklab * lms_prime
oklab_to_xyz_d65(L, a, b):
lms_prime = M_oklab_to_lms_prime * [L, a, b]
lms = [lms_prime[0]^3, lms_prime[1]^3, lms_prime[2]^3]
return M_lms_to_xyz_d65 * lms
oklab_to_oklch(L, a, b):
C = sqrt(a*a + b*b)
if C <= 0.000004:
H_standard = missing
H_display = 0
else:
H_standard = normalize_degrees(atan2(b, a) * 180 / pi)
H_display = H_standard
return L, C, H_display
oklch_to_oklab(L, C, H):
if H is missing: return [L, 0, 0]
return [L, C*cos(H*pi/180), C*sin(H*pi/180)]
Reproducible test vectors
These vectors validate normalization, RGB-family conversion, Lab conversion, OKLab conversion, and a round trip back to the canonical sRGB HEX value.
CSS lab() lightness may be written as a number or percentage; Hue Codex serializes this page's vectors as lab(46.800061 17.782586 -66.657521).
| Input | Expected output | Notes |
|---|---|---|
| #fff | #FFFFFF | Short HEX expands to six uppercase sRGB digits |
| #4169E1 to RGB | rgb(65 105 225) | Canonical sRGB channel values |
| #4169E1 to HSL | hsl(225 72.727273% 56.862745%) | RGB-derived hue, saturation, and lightness |
| hsl(225 72.727273% 56.862745%) to HEX | #4169E1 | HSL round trip returns the source HEX after channel rounding |
| #4169E1 to HWB | hwb(225 25.490196% 11.764706%) | RGB-derived whiteness and blackness |
| hwb(225 25.490196% 11.764706%) to HEX | #4169E1 | HWB round trip returns the source HEX after channel rounding |
| #4169E1 to Lab | lab(46.800061 17.782586 -66.657521) | D65 sRGB converted through D50 Lab |
| #4169E1 -> lab(46.800061 17.782586 -66.657521) -> HEX | #4169E1 | Lab round trip returns the source HEX after D65/D50 adaptation and channel rounding |
| #4169E1 to OKLab | oklab(0.559848187 -0.011820607 -0.187862028) | D65 XYZ to OKLab |
| #4169E1 -> oklch(55.984819% 0.188234 266.399596) -> HEX | #4169E1 | OKLCH round trip returns the source HEX after polar conversion and channel rounding |
| rgb(65, 105, 225) | #4169E1 | Legacy comma-separated rgb() parses to the same resolved fallback |
| rgb(65 105 225 / 50%) | #4169E180; alpha 50% | Modern slash alpha is preserved in alpha-capable previews and output while #4169E1 remains the resolved opaque channel fallback |
| rgb(255 0 0 / 0) | #FF000000; alpha 0% | Transparent red retains its red base channels and zero alpha; any contrast decision also identifies the compositing canvas |
| hsl(0.625turn 72.727273% 56.862745%) | #4169E1 | turn hue is converted to 225deg before HSL conversion |
| hsl(120 0% 50%) | #808080; derived HSL hue displays as 0 | Hue is powerless when HSL saturation is at or below 0.001 |
| hwb(270 50% 50%) | #808080; hue is non-authoritative | Hue is powerless when HWB whiteness plus blackness is at least 99.999 |
| lch(50% 0 270) | #777777; derived LCH hue displays as 0 | CIE LCH hue is missing when chroma is at or below 0.0015 |
| oklch(50% 0 270) | #636363; hue marked by neutral/powerless policy | OKLCH hue is missing when chroma is at or below 0.000004; do not treat the authored 270deg as meaningful |
| lab(46.800061%, 17.782586, -66.657521) | Rejected | Lab/LCH/OKLab/OKLCH do not accept legacy comma syntax |
| lab(none 0 0) | Rejected | Hue Codex typed conversion does not preserve CSS missing components |
| rebeccapurple | #663399 | Fixed CSS named colors resolve deterministically and remain accepted typed input |
| transparent | #00000000 | Accepted as a concrete zero-alpha color; contrast tools composite it over an explicit canvas before scoring |
| currentcolor | Rejected | Depends on cascade context and cannot resolve to a standalone fallback |
Sources and standards
These references anchor the public standards, model origins, source records, and formats used by Hue Codex. Status badges distinguish stable standards, drafts, primary sources, model sources, Hue Codex heuristics, approximations, and browser-dependent behavior.
Tools using this methodology
These Hue Codex tools link to this methodology because they depend on the formulas, assumptions, limits, or data policy described here.
Report a calculation issue
If a result does not match the documented formula or fixture, send the exact input, tool settings, displayed result, expected result, precision mode, and browser details. Please do not include private images, personal information, or secrets.