Interface Palette

A collection of PaletteColor objects.

interface Palette {
    COLORS: PaletteColor[];
    CONTRAST_MAP?: {
        #000000: string[];
        #FFFFFF: string[];
        [HEX: string]: string[];
    };
    DISCRIMINATOR: PALETTE;
    IS_GRADIENT: boolean;
    NAME: string;
    SOURCE?: string;
    SOURCE_URL?: string;
}

Properties

COLORS: PaletteColor[]

The list of PaletteColor objects that compose the palette.

CONTRAST_MAP?: {
    #000000: string[];
    #FFFFFF: string[];
    [HEX: string]: string[];
}

A map of hex color strings to arrays of hex colors, where each color in the array passes the WCAG AA standard with normal and large size text when compared to the key.
The only colors listed in this map should be the colors of the palette, black (#000000), and white (#FFFFFF).

Type declaration

  • [HEX: string]: string[]
  • Readonly#000000: string[]

    The colors in the palette that pass the WCAG AA standard when compared to black (#000000). This list should NOT contain white (#FFFFFF) unless it is a color listed in the palette.

  • Readonly#FFFFFF: string[]

    The colors in the palette that pass the WCAG AA standard when compared to white (#FFFFFF). This list should NOT contain black (#000000) unless it is a color listed in the palette.

DISCRIMINATOR: PALETTE

Discriminator for determining if an object is a Palette.

IS_GRADIENT: boolean

A flag indicating if the palette is a gradient.

NAME: string

The name of the palette.

SOURCE?: string

The source of the palette.

SOURCE_URL?: string

The source URL of the palette.