Canvas Toolkit
← Class index

CPalette

GUI and styling

Stores colors used to render widgets for different semantic roles.

import { CPalette } from "canvas-toolkit-lib";

Declared members

constructor(pal?: CPalette | null);

Creates a new CPalette instance. @param pal Pal.

color(role: CPaletteColorRole): CColor;

Returns the color assigned to the specified palette role. @param role Role. @returns The resulting value.

setColor(role: CPaletteColorRole, color: CColor): void;

Assigns a color to the specified palette role. @param role Role. @param color Color.

isEqual(other: CPalette): boolean;

Returns whether this palette is equal to another palette. @param other Other. @returns The resulting value.