MCPcopy Create free account
hub / github.com/adobe/leonardo / constructor

Method constructor

docs/ui/src/js/initialDivergingScale.js:21–55  ·  view source on GitHub ↗
({swatches, startKeys, endKeys, middleKey, colorSpace, smooth, distributeLightness = 'polynomial', shift = 1, output})

Source from the content-addressed store, hash-verified

19
20class DivergingScale {
21 constructor({swatches, startKeys, endKeys, middleKey, colorSpace, smooth, distributeLightness = 'polynomial', shift = 1, output}) {
22 this._startKeys = startKeys;
23 this._endKeys = endKeys;
24 this._middleKey = middleKey;
25 this._colorKeys = this._combineColorKeys();
26 this._distributeLightness = distributeLightness;
27 this._colorspace = colorSpace;
28 this._shift = shift;
29 this._smooth = smooth;
30 this._output = output;
31 this._swatches = swatches;
32 this._scaleSwatches = swatches / 2;
33 this._startScale = new SequentialScale({
34 swatches: this._scaleSwatches,
35 colorKeys: this._startKeys,
36 colorSpace: this._colorspace,
37 distributeLightness: this._distributeLightness,
38 smooth: this._smooth,
39 shift: this._shift,
40 output: this._output
41 });
42
43 this._endScale = new SequentialScale({
44 swatches: this._scaleSwatches,
45 colorKeys: this._endKeys,
46 colorSpace: this._colorspace,
47 distributeLightness: this._distributeLightness,
48 smooth: this._smooth,
49 shift: this._shift,
50 output: this._output
51 });
52
53 this._domains = this._getDomains();
54 this._colors = this._createColorScale();
55 }
56
57 set startKeys(colors) {
58 this._startKeys = colors;

Callers

nothing calls this directly

Calls 3

_combineColorKeysMethod · 0.95
_getDomainsMethod · 0.95
_createColorScaleMethod · 0.95

Tested by

no test coverage detected