-
Notifications
You must be signed in to change notification settings - Fork 35
Expand file tree
/
Copy pathdefinition.js
More file actions
48 lines (39 loc) · 894 Bytes
/
definition.js
File metadata and controls
48 lines (39 loc) · 894 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/**
* Implements DIN99d
*/
import convertRgbToXyz65 from '../xyz65/convertRgbToXyz65.js';
import convertXyz65ToD99d from './convertXyz65ToD99d.js';
import { interpolatorLinear } from '../interpolate/linear.js';
import { fixupAlpha } from '../fixup/alpha.js';
import { differenceEuclidean } from '../difference.js';
const definition = {
mode: 'd99d',
parse: ['--din99d-labch'],
serialize: '--din99d-labch',
fromMode: {
xyz65: convertXyz65ToD99d,
// @ts-ignore
rgb: c => convertXyz65ToD99d(convertRgbToXyz65(c))
},
channels: ['l', 'a', 'b', 'alpha'],
ranges: {
l: [0, 100],
a: [-55, 55],
b: [-55, 55],
c: [0, 55],
h: [0, 360]
},
interpolate: {
l: interpolatorLinear,
a: interpolatorLinear,
b: interpolatorLinear,
alpha: {
use: interpolatorLinear,
fixup: fixupAlpha
}
},
difference: {
h: differenceEuclidean
}
};
export default definition;