Color Map
About 351 words
Color Map is UInk's unified color structure: a required sRGB color fallback, plus an optional HDR color. Ink colors, Shape strokes and fills, and page backgrounds all use it.
Levels
- Core:
fallback. - Full:
space+components(HDR and precise color).
Fields
| Field | Type | Requirement | Level | Description |
|---|---|---|---|---|
fallback | uint32 | Required | Core | sRGB color in 0xRRGGBB format |
space | string | Conditional | Full | Color space; appears paired with components |
components | Array<float32>(3) | Conditional | Full | The three components in that color space |
Registered space values:
| Value | Components |
|---|---|
srgb | Uses the sRGB transfer function; all three components are in the inclusive range from 0 to 1 |
scrgb | Linear components; may exceed 1 to represent HDR highlights; must be finite numbers |
HDR screen · Full reader
Illustration
space: "scrgb"components: [1.8, 0.65, 0.1]Components are linear; anything above 1 is brighter than SDR white, and how it maps to the screen is up to the app (COLOR-4). Web pages cannot reliably show HDR, so the swatch above is only an illustration.
SDR screen · below Full
fallback: 0xFFCC00R 255 · G 204 · B 0
The writer makes fallback represent how this color should look on an SDR screen (COLOR-1). It is used whenever HDR is unavailable or the extended color is invalid.
Rules
- COLOR-1 Writers must ensure
fallbackdoes not exceed0xFFFFFFand that it represents how the extended color should look on an SDR screen. - COLOR-2 Readers choose the color in the following order:
- Both
spaceandcomponentsare missing: usefallback. - Only one of them appears: the extended color is invalid; use
fallback. spaceis unknown,componentsdoes not have length 3, any component is not a finite number, or ansrgbcomponent is outside0–1: usefallback.- Otherwise, use the extended color.
- Both
- COLOR-3 If
fallbackis greater than0xFFFFFF, readers may recover by using only the least significant 24 bits. Whenfallbackis missing or of the wrong type, the color or style it belongs to is invalid and is handled by the error-tolerance rules of the block it belongs to. - COLOR-4 Gamut mapping and HDR / SDR tone mapping are up to the app; UInk does not guarantee pixel-identical colors across screens.
Example
{
"fallback": 16763904, // 0xFFCC00
"space": "scrgb",
"components": [1.8, 0.65, 0.1]
}Fallback
| Capability the reader lacks | How it is shown |
|---|---|
| HDR (below Full) | Uses fallback |