Interface SerializeOptions

interface SerializeOptions {
    alpha?:
        | boolean
        | "<number>"
        | "<percentage>"
        | {
            include?: boolean;
            type?: "<number>" | "<percentage>";
        };
    commas?: boolean;
    coords?: string[];
    format?: string | SpaceFormat;
    inGamut?: boolean;
    precision?: number;
}

Properties

alpha?:
    | boolean
    | "<number>"
    | "<percentage>"
    | {
        include?: boolean;
        type?: "<number>" | "<percentage>";
    }

Alpha format

commas?: boolean

Force commas as a separator

false
coords?: string[]

Coordinate format to override the default

format?: string | SpaceFormat

Output format id. Defaults to the parsed format if available (and can serialize), or the color space default otherwise

"default"
inGamut?: boolean

Adjust coordinates to fit in gamut first

false
precision?: number

Significant digits