import genMethod from "../types/genMethod.js"; import hex from "../types/hexType.js"; import hsl from "../types/hslType.js"; import rgb from "../types/rgbType.js"; type ColorTypes = 'rgb' | 'hsl' | 'OkLCh'; /** A representation of color */ export default class Color { h: number; C: number; L: number; /** * Create a color instance * @param {[number, number, number]} color array representing a color in non-normalized OKLCh by default * @param {ColorTypes} [colorType=OkLCh] color array type, default = OkLCh * @param {boolean} [isNormalized=false] specifies is array normalized, default = false */ constructor(color: [number, number, number], colorType?: ColorTypes, isNormalized?: boolean); /** * Create a color instance from css rgb / hsl string * @param color css rgb / hsl color string */ constructor(color: string); /** * Create a color instance from hex string * @param {hex} color hex string */ constructor(color: hex); /** * Create a color instance from another color instance * @param {Color} color instance of Color */ constructor(color: Color); /** * Get the hsl array of a color * @returns {hsl} returns hsl array */ getHslArray(): hsl; /** * Get the non-normalized okLCh array of a color * @returns {okLCh} returns okLCh array */ getOkLChArray(): hsl; /** * Get the rgb array of a color * @returns {rgb} returns rgb array */ getRgbArray(): rgb; /** * Get the css hsl string of a color * @returns {string} hsl string in css format */ getCssHsl(): string; /** * Get the css rgb string of a color * @returns {string} rgb string in css format */ getCssRgb(): string; /** * Get the hex string of a color * @returns {hex} hex string in */ getCssHex(): hex; /** * Get the hex string of a color * @returns {hex} hex string in */ getCssOklch(): string; /** * Shifts hue value by a step value * @param step amount of adjustment to hue value */ shiftH(step: number): void; /** * Shifts chroma value by a step value * @param step amount of adjustment to chroma value */ shiftC(step: number): void; /** * Shifts lightness value by a step value * @param step amount of adjustment to lightness value */ shiftL(step: number): void; /** * Generates color scheme based on color instance * @param {number} colorAmount amount of colors to be generated * @param {genMethod} [method] method of color scheme generation * @returns {Color[]} color scheme */ getColorScheme(colorAmount: number, method?: genMethod): Color[]; /** * Generates color shades based on seedColor. * @param {number} colorAmount amount of generated color shades * @param {number} [step] lightnes value step * @returns {Color[]} array of generated color shades */ getShades(colorAmount: number, step?: number): Color[]; /** * Generates analogous colors * @param {number} colorAmount amount of generated analogous colors * @param {number} [step] hue value step * @returns {Color[]} array of generated colors */ getAnalogous(colorAmount: number, step?: number): Color[]; /** * Generates complementary colors * @param {number} colorAmount amount of generated complementary colors * @returns {Color[]} array of generated colors */ getComplementary(colorAmount: number): Color[]; /** * Generates split complementary colors * @param {number} colorAmount amount of generated split complementary colors * @param {number} [offset] offset between split complimentary colors * @param {number} [splitAmount] amount of splitted color * @returns {Color[]} array of generated colors */ getSplitComplementary(colorAmount: number, offset?: number, splitAmount?: number): Color[]; /** * Generates quadratic colors * @param {number} colorAmount amount of generated quadratic colors * @returns {Color[]} array of generated colors */ getQuadratic(colorAmount: number): Color[]; /** * Generates tetraidic colors * @param {number} colorAmount amount of generated tetraidic colors * @param {number} [ascpectRatio] ratio between sides in [0; 1] * @returns {Color[]} array of generated colors */ getTetraidic(colorAmount: number, ascpectRatio?: number): Color[]; /** * Generates triadic colors * @param {number} colorAmount amount of generated triadic colors * @returns {Color[]} array of generated colors */ getTriadic(colorAmount: number): Color[]; } export { Color };