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

Function baseScaleOptions

docs/ui/src/js/createBaseScaleOptions.js:18–38  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

16
17// Create options for colors to use as base scale
18function baseScaleOptions() {
19 let baseSelect = document.getElementById('themeBase');
20 let colorNames = getAllColorNames();
21
22 // Remove all existing options and start from scratch
23 var i,
24 L = baseSelect.options.length - 1;
25 for (i = L; i >= 0; i--) {
26 baseSelect.remove(i);
27 }
28
29 let opts = {};
30 for (let i = 0; i < colorNames.length; i++) {
31 let colorname = colorNames[i];
32 opts[colorname] = colorname;
33 }
34
35 for (let index in opts) {
36 baseSelect.options[baseSelect.options.length] = new Option(opts[index], index);
37 }
38}
39
40let baseSelect = document.getElementById('themeBase');
41baseSelect.addEventListener('change', function (e) {

Callers 4

paramSetupFunction · 0.90
addColorScaleFunction · 0.90
themeDeleteItemFunction · 0.90
showColorDetailsFunction · 0.90

Calls 1

getAllColorNamesFunction · 0.90

Tested by

no test coverage detected