@lithiumjs/ngx-material-theming
Version:
Dynamic and customizable Angular Material theming made easy.
43 lines (42 loc) • 1.84 kB
TypeScript
import { PaletteOffset, TemplateThemeCreationOptions, ThemeCreator } from "./theme-creator";
/**
* @param isDark Whether or not the theme should be a dark theme. Defaults to `false`.
* @see TemplateThemeCreationOptions
*/
export interface ThemeCreationOptions extends Omit<TemplateThemeCreationOptions, "templateData" | "templateOptions"> {
isDark?: boolean;
}
export declare class ThemeGenerator {
/**
* @see ThemeCreator.createFromTemplate
*/
static createFromTemplate(options: TemplateThemeCreationOptions): string;
/**
* @description Creates a new theme from the given theme palettes and loads it for use with the given name.
* @param options The options to use to create the new theme.
* @return The compiled theme.
*/
static create(options: ThemeCreationOptions): string;
/**
* @description Computes a Material color palette for the given `baseColor`.
* @param baseColor The color that the palette will be based off of.
* @requires chroma-js
*/
static createPalette(baseColor: string): ThemeCreator.Palette;
/**
* @description Computes a color for a Material theme palette using `baseColor` and the given `paletteOffset`.
* @param baseColor The base color.
* @param paletteOffset The offset in the palette.
* @return The new color to be used for the given palette offset.
* @requires chroma-js
*/
static paletteColor(baseColor: string, paletteOffset: PaletteOffset): string;
/**
* @description Computes an appropriate contrast color (either black or white) that contrasts the given `color`.
* @param color The color to be contrasted.
* @return The contrast color.
* @requires chroma-js
*/
static contrastColor(color: string): string;
private static loadStandardThemeTemplate;
}