API reference

color.cpp · CSS properties

Browse entries grouped by interface file. Expand an entry for declarations, usage and version boundaries.

Read the related guide →

Entries retain declarations and sources. Runtime verification is recorded per entry; internal source candidates are not a promise of SDK delivery.

src/core/color.cpp
命名颜色与 transparent
supported3.61.7C++ / C / Go / Rust

A complete built-in named-color table with ASCII case-insensitive matching. Color values are ultimately stored as 8-bit RGBA.

color.cpp
CSS opaque named colors(含别名、rebeccapurple)| transparent

Historical audit version: 3.59.0 · 2026-11-01 Asia/Shanghai (UTC+08:00)

Verification scope

Imported static source audit from 2026-11-01 / 3.59.0. References are available; this is not a fresh runtime verification of this release.

src/core/color.cpp:13

Report an issue with this entry →
十六进制颜色
supported3.61.7C++ / C / Go / Rust

Requires 3/4/6/8 valid hexadecimal digits; alpha comes last.

color.cpp
#RGB | #RGBA | #RRGGBB | #RRGGBBAA

Historical audit version: 3.59.0 · 2026-11-01 Asia/Shanghai (UTC+08:00)

Verification scope

Imported static source audit from 2026-11-01 / 3.59.0. References are available; this is not a fresh runtime verification of this release.

src/core/color.cpp:166

Report an issue with this entry →
color-mix()
Partial3.61.7C++ / C / Go / Rust

Computes weighted mixtures of two colors, but oklab/oklch actually share Lab interpolation. Splits on bare commas, limiting nested color functions and color functions containing commas. Alpha is directly weighted and weights are normalized; this is not the full premultiplied-alpha or attenuation model for weights totaling less than 100%. Hue interpolation methods are not modeled; other spaces fall back to sRGB.

color.cpp
color-mix(in srgb | srgb-linear | lab | lch | oklab | oklch, color [p%], color [p%])

Historical audit version: 3.59.0 · 2026-11-01 Asia/Shanghai (UTC+08:00)

Verification scope

Imported static source audit from 2026-11-01 / 3.59.0. References are available; this is not a fresh runtime verification of this release.

src/core/color.cpp:844

Report an issue with this entry →
color()
Partial3.61.7C++ / C / Go / Rust

Includes conversion branches for predefined color spaces, with results clamped to 8-bit sRGB. Does not provide custom ICC profiles, a wide-gamut framebuffer or the full strict CSS Color grammar. Unknown spaces lack a reliable rejection branch, so acceptance does not establish support.

color.cpp
color(srgb | srgb-linear | display-p3 | display-p3-linear | a98-rgb | prophoto-rgb | rec2020 | xyz | xyz-d50 | xyz-d65  <3 channels> [/ alpha])

Historical audit version: 3.59.0 · 2026-11-01 Asia/Shanghai (UTC+08:00)

Verification scope

Imported static source audit from 2026-11-01 / 3.59.0. References are available; this is not a fresh runtime verification of this release.

src/core/color.cpp:430

Report an issue with this entry →
contrast-color()
Partial3.61.7C++ / C / Go / Rust

Recursively parses absolute colors and selects black or white by sRGB relative-luminance contrast. Transparent arguments are not composited over a specific background. The caller must resolve contextual colors first; this is not a complete general color-context model.

color.cpp
contrast-color(<absolute-color>)

Historical audit version: 3.59.0 · 2026-11-01 Asia/Shanghai (UTC+08:00)

Verification scope

Imported static source audit from 2026-11-01 / 3.59.0. References are available; this is not a fresh runtime verification of this release.

src/core/color.cpp:249

Report an issue with this entry →
device-cmyk()
Unsupported3.61.7C++ / C / Go / Rust

Color::parse has no branch for this function. Storing its text or tolerating an unknown function does not implement its color semantics.

color.cpp
device-cmyk(...)

Historical audit version: 3.59.0 · 2026-11-01 Asia/Shanghai (UTC+08:00)

Verification scope

Imported static source audit from 2026-11-01 / 3.59.0. References are available; this is not a fresh runtime verification of this release.

src/core/color.cpp:162

Report an issue with this entry →
hsl() / hsla()
Partial3.61.7C++ / C / Go / Rust

Converts hue units deg/rad/grad/turn. The parser has nonstandard error tolerance, converts none to numeric 0, and does not preserve missing components for interpolation or provide general relative syntax.

color.cpp
hsl(<hue> <percentage> <percentage> / <alpha>);也接受逗号形式

Historical audit version: 3.59.0 · 2026-11-01 Asia/Shanghai (UTC+08:00)

Verification scope

Imported static source audit from 2026-11-01 / 3.59.0. References are available; this is not a fresh runtime verification of this release.

src/core/color.cpp:373

Report an issue with this entry →
hwb()
Partial3.61.7C++ / C / Go / Rust

Converts to sRGB. The current HWB hue branch takes the raw numeric value without rad/grad/turn conversion. Full none/relative syntax and strict separator syntax are not guaranteed.

color.cpp
hwb(<hue> <whiteness> <blackness> / <alpha>)

Historical audit version: 3.59.0 · 2026-11-01 Asia/Shanghai (UTC+08:00)

Verification scope

Imported static source audit from 2026-11-01 / 3.59.0. References are available; this is not a fresh runtime verification of this release.

src/core/color.cpp:594

Report an issue with this entry →
lab()
Partial3.61.7C++ / C / Go / Rust

Converts D50 Lab to XYZ to sRGB. Fast returns at L values of 0/100 discard the authored alpha. Does not provide full missing-component or relative-color syntax.

color.cpp
lab(L a b [/ alpha])

Historical audit version: 3.59.0 · 2026-11-01 Asia/Shanghai (UTC+08:00)

Verification scope

Imported static source audit from 2026-11-01 / 3.59.0. References are available; this is not a fresh runtime verification of this release.

src/core/color.cpp:641

Report an issue with this entry →
lch()
Partial3.61.7C++ / C / Go / Rust

Converts through D50 Lab; hue accepts angle units. Fast returns at L values of 0/100 discard alpha. C percentages do not use the standard proportional conversion.

color.cpp
lch(L C H [/ alpha])

Historical audit version: 3.59.0 · 2026-11-01 Asia/Shanghai (UTC+08:00)

Verification scope

Imported static source audit from 2026-11-01 / 3.59.0. References are available; this is not a fresh runtime verification of this release.

src/core/color.cpp:690

Report an issue with this entry →
light-dark()
Unsupported3.61.7C++ / C / Go / Rust

Color::parse has no branch for this function. Storing its text or tolerating an unknown function does not implement its color semantics.

color.cpp
light-dark(...)

Historical audit version: 3.59.0 · 2026-11-01 Asia/Shanghai (UTC+08:00)

Verification scope

Imported static source audit from 2026-11-01 / 3.59.0. References are available; this is not a fresh runtime verification of this release.

src/core/color.cpp:162

Report an issue with this entry →
oklab()
Partial3.61.7C++ / C / Go / Rust

Supports percentage conversion for L and a/b, and alpha. Compresses results into 8-bit sRGB and clamps out-of-gamut components. Does not provide the full missing-component or relative-color model.

color.cpp
oklab(L a b [/ alpha])

Historical audit version: 3.59.0 · 2026-11-01 Asia/Shanghai (UTC+08:00)

Verification scope

Imported static source audit from 2026-11-01 / 3.59.0. References are available; this is not a fresh runtime verification of this release.

src/core/color.cpp:807

Report an issue with this entry →
oklch()
Partial3.61.7C++ / C / Go / Rust

Supports L/C percentages, hue angles and alpha. Clamps intermediate matrix values and returns 8-bit sRGB; wide gamut is not preserved.

color.cpp
oklch(L C H [/ alpha])

Historical audit version: 3.59.0 · 2026-11-01 Asia/Shanghai (UTC+08:00)

Verification scope

Imported static source audit from 2026-11-01 / 3.59.0. References are available; this is not a fresh runtime verification of this release.

src/core/color.cpp:754

Report an issue with this entry →
rgb() / rgba()
Partial3.61.7C++ / C / Go / Rust

Accepts legacy comma-separated and modern space/slash numeric forms. Numbers and percentages are truncated and rounded to 8-bit values. Does not implement the full strict CSS Color grammar: unknown tokens receive error tolerance and relative rgb(from ...) is not modeled. Accepted malformed input must not be presented as a feature.

color.cpp
rgb(255,128,0) | rgb(100% 50% 0% / 50%) | rgba(255,0,0,.5)

Historical audit version: 3.59.0 · 2026-11-01 Asia/Shanghai (UTC+08:00)

Verification scope

Imported static source audit from 2026-11-01 / 3.59.0. References are available; this is not a fresh runtime verification of this release.

src/core/color.cpp:328

Report an issue with this entry →
system colors
Partial3.61.7C++ / C / Go / Rust

Uses a fixed light palette and does not read OS theme or high-contrast settings. AccentColor here is a color keyword; it does not mean the accent-color property takes effect.

color.cpp
Canvas / CanvasText / ButtonFace / ButtonBorder / Field / FieldText / Highlight / HighlightText / LinkText / VisitedText / ActiveText / GrayText / Mark / MarkText / AccentColor / AccentColorText;另有旧 system aliases

Historical audit version: 3.59.0 · 2026-11-01 Asia/Shanghai (UTC+08:00)

Verification scope

Imported static source audit from 2026-11-01 / 3.59.0. References are available; this is not a fresh runtime verification of this release.

src/core/color.cpp:99

Report an issue with this entry →
Browse this reference type →