Skip to main content

Palettes

A palette is a set of colors extracted from an image, such as a game's box art or a viewer's avatar. Pass it to a field's apply so accent colors follow the image.

getPalette​

breezy.getPalette(image: string): Promise<Palette | null>

image is the image URL. Results are cached per URL.

let palette = await breezy.getPalette(user.profilePictureUrl)

breezy.getField('background').apply('.card', palette)

Palette​

type Palette = Dictionary<Swatch>

type Swatch = {
label: string
color: string
value: Color
}

type Color = {
rgba: Array<number>
hsla: Array<number>
hsva: Array<number>
hex: string
}