🚑 Fix broken color

This commit is contained in:
Robin van der Linde 2025-01-07 23:24:14 +01:00
parent 852dd51726
commit 99ed1d362f
Signed by: Robin-van-der-Linde
GPG key ID: 53956B3252478F0D

View file

@ -90,24 +90,24 @@ export function mapCompleteToVScode(color: string): vscodeColor | undefined {
switch (color.length) {
case 4:
return new vscodeColor(
parseInt(color[1] + color[1], 16) / 255,
parseInt(color[2] + color[2], 16) / 255,
parseInt(color[3] + color[3], 16) / 255,
parseInt(color.substring(1, 2), 16) / 255,
parseInt(color.substring(2, 3), 16) / 255,
parseInt(color.substring(3, 4), 16) / 255,
1
);
case 7:
return new vscodeColor(
parseInt(color.substring(1, 2), 16) / 255,
parseInt(color.substring(3, 2), 16) / 255,
parseInt(color.substring(5, 2), 16) / 255,
parseInt(color.substring(1, 3), 16) / 255,
parseInt(color.substring(3, 5), 16) / 255,
parseInt(color.substring(5, 7), 16) / 255,
1
);
case 9:
return new vscodeColor(
parseInt(color.substring(1, 2), 16) / 255,
parseInt(color.substring(3, 2), 16) / 255,
parseInt(color.substring(5, 2), 16) / 255,
parseInt(color.substring(7, 2), 16) / 255
parseInt(color.substring(1, 3), 16) / 255,
parseInt(color.substring(3, 5), 16) / 255,
parseInt(color.substring(5, 7), 16) / 255,
parseInt(color.substring(7, 9), 16) / 255
);
default:
return undefined;