UNPKG

themer

Version:

Customizable theme creator for editors, terminals, wallpaper, and more.

66 lines (65 loc) 1.84 kB
type FullShades = { shade0: string; shade1: string; shade2: string; shade3: string; shade4: string; shade5: string; shade6: string; shade7: string; }; type PartialShades = { shade0: string; shade7: string; }; export type Accents = { accent0: string; accent1: string; accent2: string; accent3: string; accent4: string; accent5: string; accent6: string; accent7: string; }; type LightVariantBase<T extends Variant> = { light: T; }; type DarkVariantBase<T extends Variant> = { dark: T; }; type VariantBase<T extends Variant> = LightVariantBase<T> | DarkVariantBase<T> | (LightVariantBase<T> & DarkVariantBase<T>); type ColorSetBase<T extends Variant> = { name: string; variants: VariantBase<T>; }; type PartialVariant = PartialShades & Accents; export type FullVariant = FullShades & Accents; export type Variant = PartialVariant | FullVariant; export type PartialColorSet = ColorSetBase<PartialVariant>; export type FullColorSet = ColorSetBase<FullVariant>; export type ColorSet = PartialColorSet | FullColorSet; export type AnnotatedVariant = { name: string; colors: FullVariant; isDark: boolean; title: { human: string; kebab: string; snake: string; upperCamel: string; }; }; export type AnnotatedColorSet = FullColorSet & { title: { human: string; kebab: string; snake: string; upperCamel: string; }; }; export declare function colorSetToVariants(colorSet: AnnotatedColorSet): AnnotatedVariant[]; export declare function prepareColorSet(colorSet: ColorSet): AnnotatedColorSet; export declare function prepareVariant(variant: Variant): FullVariant; export declare function brightMix(colors: FullVariant, key: keyof FullVariant, isDark: boolean): string; export {};