| 1 |
/** |
| 2 |
* HelmGenLCh — cylindrical form of Helmlab GenSpace. |
| 3 |
* |
| 4 |
* Converts GenSpace's rectangular (L, a, b) coordinates to |
| 5 |
* cylindrical (L, C, h). Ideal for CSS interpolation contexts |
| 6 |
* like gradients and color-mix where hue angle matters. |
| 7 |
* |
| 8 |
* @see https://github.com/Grkmyldz148/helmlab |
| 9 |
*/ |
| 10 |
import ColorSpace from "../ColorSpace.js"; |
| 11 |
import HelmGen from "./helmgen.js"; |
| 12 |
import lch from "./lch.js"; |
| 13 |
|
| 14 |
export default new ColorSpace({ |
| 15 |
id: "helmgenlch", |
| 16 |
name: "HelmGenLCh", |
| 17 |
cssId: "--helmgenlch", |
| 18 |
coords: { |
| 19 |
l: { |
| 20 |
refRange: [0, 1], |
| 21 |
name: "Lightness", |
| 22 |
}, |
| 23 |
c: { |
| 24 |
refRange: [0, 0.65], |
| 25 |
name: "Chroma", |
| 26 |
}, |
| 27 |
h: { |
| 28 |
refRange: [0, 360], |
| 29 |
type: "angle", |
| 30 |
name: "Hue", |
| 31 |
}, |
| 32 |
}, |
| 33 |
white: "D65", |
| 34 |
|
| 35 |
base: HelmGen, |
| 36 |
fromBase: lch.fromBase, |
| 37 |
toBase: lch.toBase, |
| 38 |
}); |