Skip to main content

generateTheme()

function generateTheme<T>(options): ThemeType<T>

Generates a color theme based on the provided options

Type Parameters

Type ParameterDefault typeDescription
T extends booleanfalseBoolean type parameter that determines if the theme palette should be expanded

Parameters

ParameterTypeDescription
optionsGenerateThemeOptions<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

Defined in

tailwind/tailwind.ts:54