Fix allowTransparency in lib and demo

Fixes #5558
Fixes #5560
This commit is contained in:
Daniel Imms
2025-12-31 05:00:33 -08:00
parent 982f5e15ff
commit d143340b60
7 changed files with 100 additions and 64 deletions
+8
View File
@@ -184,6 +184,14 @@ export namespace css {
return channels.toColor($r, $g, $b, $a);
}
// Handle the "transparent" keyword
if (css === 'transparent') {
return {
css: 'transparent',
rgba: 0x00000000
};
}
// Validate the context is available for canvas-based color parsing
if (!$ctx || !$litmusColor) {
throw new Error('css.toColor: Unsupported css format');