Skip to content

Commit e75b61f

Browse files
committed
fix color
1 parent 5ac0983 commit e75b61f

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@node-projects/svghmi.webcomponent",
3-
"version": "0.0.7",
3+
"version": "0.0.8",
44
"description": "a svghmi webcomponent.",
55
"type": "module",
66
"main": "./dist/index.js",

src/Converter.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,10 @@ export class Converter {
7272
static Iluminate(input: string, deviation: number, low = '#FFFFFF', high = '#000000') {
7373
deviation = Math.max(-1, Math.min(1, deviation)); // Clamp deviation to [-1, 1]
7474

75-
let inputHSL = hexToHSL(input);
75+
let hex = input;
76+
if (hex.startsWith("0x"))
77+
hex = hex.substring(4);
78+
let inputHSL = hexToHSL(hex);
7679
let lowHSL = hexToHSL(low);
7780
let highHSL = hexToHSL(high);
7881

0 commit comments

Comments
 (0)