meo-canvas
    Preparing search index...

    Interface Rgba

    A colour as four channels: r, g, b in 0–255 and a in 0–1.

    interface Rgba {
        a: number;
        b: number;
        g: number;
        r: number;
    }
    Index
    a b g r
    a: number

    Alpha, nominally 0 to 1 and not clamped either.

    parseColor returns the number the author wrote: 0.1 reads back as 0.1, and a hex byte as byte / 255.

    b: number

    Blue, on the same terms.

    g: number

    Green, on the same terms.

    r: number

    Red, nominally 0 to 255 and not clamped to it.

    Mixing past either end of a range leaves the channel outside the gamut, and that is kept rather than flattened: formatColor writes such a colour as color(srgb ...), which can express it, instead of a hex triple that cannot.