| 1 |
import ColorSpace from "../ColorSpace.js"; |
| 2 |
import OKLab from "./oklab.js"; |
| 3 |
import lch from "./lch.js"; |
| 4 |
|
| 5 |
export default new ColorSpace({ |
| 6 |
id: "oklch", |
| 7 |
name: "OkLCh", |
| 8 |
coords: { |
| 9 |
l: { |
| 10 |
refRange: [0, 1], |
| 11 |
name: "Lightness", |
| 12 |
}, |
| 13 |
c: { |
| 14 |
refRange: [0, 0.4], |
| 15 |
name: "Chroma", |
| 16 |
}, |
| 17 |
h: { |
| 18 |
refRange: [0, 360], |
| 19 |
type: "angle", |
| 20 |
name: "Hue", |
| 21 |
}, |
| 22 |
}, |
| 23 |
white: "D65", |
| 24 |
|
| 25 |
base: OKLab, |
| 26 |
fromBase: lch.fromBase, |
| 27 |
toBase: lch.toBase, |
| 28 |
|
| 29 |
formats: { |
| 30 |
oklch: { |
| 31 |
coords: ["<percentage> | <number>", "<number> | <percentage>", "<number> | <angle>"], |
| 32 |
}, |
| 33 |
}, |
| 34 |
}); |