Fix create color range

This commit is contained in:
Vladyslav 2020-03-05 13:17:58 +02:00 committed by Andrew Shvayka
parent c9b1e24e24
commit ee07ddb876

View File

@ -247,18 +247,18 @@ export class CanvasDigitalGauge extends BaseGauge {
if (levelColor !== null) {
let percentage = isColorProperty ? inc * i : CanvasDigitalGauge.normalizeValue(levelColor.value, options.minValue, options.maxValue);
let tColor = tinycolor(isColorProperty ? levelColor : levelColor.color);
options.colorsRange[i] = {
options.colorsRange.push({
pct: percentage,
color: tColor.toRgb(),
rgbString: tColor.toRgbString()
};
});
if (options.neonGlowBrightness) {
tColor = tinycolor(isColorProperty ? levelColor : levelColor.color).brighten(options.neonGlowBrightness);
options.neonColorsRange[i] = {
options.neonColorsRange.push({
pct: percentage,
color: tColor.toRgb(),
rgbString: tColor.toRgbString()
};
});
}
}
}