Skip to content

Commit

Permalink
Throw error when wrong color format
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelselleck committed Oct 22, 2023
1 parent 3eab080 commit 09d92fa
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -714,10 +714,8 @@ var Pax = (() => {
let p = style.fill.Hsl;
newValue = `hsl(${p[0] * 255},${p[1] * 255},${p[2] * 255})`;
} else {
console.log("unsupported color type!");
newValue = `rgb(255, 0, 255)`;
throw new TypeError("Unsupported Color Format");
}

textChild.style.color = newValue;
}
if (style.font_size) {
Expand Down
3 changes: 1 addition & 2 deletions pax-chassis-web/interface/src/classes/native-element-pool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,7 @@ export class NativeElementPool {
let p = style.fill.Hsl;
newValue = `hsl(${p[0] * 255},${p[1] * 255},${p[2] * 255})`;
} else {
console.log("unsupported color type!");
newValue = `rgb(255, 0, 255)`;
throw new TypeError("Unsupported Color Format");
}
textChild.style.color = newValue;
}
Expand Down

0 comments on commit 09d92fa

Please sign in to comment.