diff --git a/web/CXM_style_tools.anubis b/web/CXM_style_tools.anubis new file mode 100644 index 0000000..776903b --- /dev/null +++ b/web/CXM_style_tools.anubis @@ -0,0 +1,18 @@ +public define String + format_rgba_to_style_color + ( + RGBA color + ) = + if color is + { + rgba(r, g, b, a) then + with alpha_str = + if to_Float(word32(word16(a, 0), word16(0, 0))) / 255.0 is + { + failure then "1", + success(v) then + float_to_string(v, 8) + }, + + "rgba(" + to_decimal(r) + "," + to_decimal(g) + "," + to_decimal(b) + "," + alpha_str + ");" + }. -- libgit2 0.21.4