generateTheme()
function generateTheme<T>(options): ThemeType<T>
Generates a color theme based on the provided options
Type Parameters
| Type Parameter | Default type | Description |
|---|---|---|
T extends boolean | false | Boolean type parameter that determines if the theme palette should be expanded |
Parameters
| Parameter | Type | Description |
|---|---|---|
options | GenerateThemeOptions<T> | The options for generating the theme |
Returns
ThemeType<T>
A complete color theme with all color variations
Example
// Generate a regular theme
const regularTheme = generateTheme({
baseColor: '#3498db'
});
console.log(regularTheme.brand.active);
// Please check ColorSet type for more information
// Generate an expanded theme
const expandedTheme = generateTheme({
baseColor: '#3498db',
expandPalette: true,
colorScheme: 'analogous'
});
console.log(expandedTheme.brand.palette[500]);
// Please check ExpandedColorSet type for more information