style_tools.anubis 560 Bytes
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 + ");"
        }.