theme/material3/color.go

Functions Structs

Functions

func Dark

Dark generates a dark color scheme from a seed color.

 

The seed color is used to derive a full set of harmonious colors

following Material 3 tonal mapping rules for dark themes.

func Dark(seed widget.Color) ColorScheme {
	p := newCorePalette(seed)
	return darkFromPalette(p)
}

func Light

Light generates a light color scheme from a seed color.

 

The seed color is used to derive a full set of harmonious colors

following Material 3 tonal mapping rules for light themes.

func Light(seed widget.Color) ColorScheme {
	p := newCorePalette(seed)
	return lightFromPalette(p)
}

Structs

type ColorScheme struct

ColorScheme holds all Material 3 color roles.

 

Material 3 defines a comprehensive set of color roles organized in

primary/secondary/tertiary/error groups, each with container variants

and corresponding "on" colors for content placed on top. Surface

colors provide a neutral backdrop with multiple elevation levels.

type ColorScheme struct {
	// Primary group: key brand color and its variants.
	Primary			widget.Color
	OnPrimary		widget.Color
	PrimaryContainer	widget.Color
	OnPrimaryContainer	widget.Color

	// Secondary group: accent color for less prominent elements.
	Secondary		widget.Color
	OnSecondary		widget.Color
	SecondaryContainer	widget.Color
	OnSecondaryContainer	widget.Color

	// Tertiary group: complementary color for contrast and balance.
	Tertiary		widget.Color
	OnTertiary		widget.Color
	TertiaryContainer	widget.Color
	OnTertiaryContainer	widget.Color

	// Error group: error states and destructive actions.
	Error			widget.Color
	OnError			widget.Color
	ErrorContainer		widget.Color
	OnErrorContainer	widget.Color

	// Surface group: neutral backgrounds at various elevation levels.
	Surface			widget.Color
	OnSurface		widget.Color
	SurfaceVariant		widget.Color
	OnSurfaceVariant	widget.Color
	SurfaceContainerLowest	widget.Color
	SurfaceContainerLow	widget.Color
	SurfaceContainer	widget.Color
	SurfaceContainerHigh	widget.Color
	SurfaceContainerHighest	widget.Color

	// Background colors.
	Background	widget.Color
	OnBackground	widget.Color

	// Outline colors for borders and dividers.
	Outline		widget.Color
	OutlineVariant	widget.Color

	// Inverse colors for elements that appear on inverse surfaces.
	InverseSurface		widget.Color
	InverseOnSurface	widget.Color
	InversePrimary		widget.Color
}