UNPKG

@weme-ui/colors

Version:
31 lines (30 loc) 1.62 kB
import "@radix-ui/colors"; import Color from "colorjs.io"; //#region src/types.d.ts type ColorAppearance = 'light' | 'dark'; type ColorType = 'accent' | 'neutral'; type ColorScalesArray<T = string> = [T, T, T, T, T, T, T, T, T, T, T, T]; type Colors<T = string> = Record<string, ColorScalesArray<T>>; //#endregion //#region src/colors.d.ts declare function getColors(appearance: ColorAppearance, isNeutral?: boolean): Colors<Color>; //#endregion //#region src/transform.d.ts interface TransformColorOptions { color: string; appearance?: ColorAppearance; isNeutral?: boolean; background?: string; } declare function transformColor({ color, appearance, isNeutral, background }: TransformColorOptions): ColorScalesArray; //#endregion //#region src/utils.d.ts declare function getColorNames(type?: ColorType): readonly ["gray", "mauve", "slate", "sage", "olive", "sand"] | readonly ["tomato", "red", "ruby", "crimson", "pink", "plum", "purple", "violet", "iris", "indigo", "blue", "cyan", "teal", "jade", "green", "grass", "bronze", "gold", "brown", "orange", "amber", "yellow", "lime", "mint", "sky"] | readonly ["black", "white", "gray", "mauve", "slate", "sage", "olive", "sand", "tomato", "red", "ruby", "crimson", "pink", "plum", "purple", "violet", "iris", "indigo", "blue", "cyan", "teal", "jade", "green", "grass", "bronze", "gold", "brown", "orange", "amber", "yellow", "lime", "mint", "sky"]; declare function toColorString(colorOrStr: Color | string): string; //#endregion export { ColorAppearance, ColorScalesArray, ColorType, Colors, getColorNames, getColors, toColorString, transformColor };