Skip to content

Colors

Colors is the color set of the Nago design system. It holds the actual values behind the theme color names like M4 or I0 for one color scheme (light or dark). Usually the theme system computes it from the main, accent and interactive colors of your theme; read the current values with core.Colors[Colors](wnd).

oraColors := core.Colors[Colors](wnd)

return Text("hello world").
	Color(oraColors.I0).
	BackgroundColor(oraColors.M0)

Colors implements core.ColorSet. You can define your own color sets the same way: a struct with public Color fields, a unique namespace and default values. Register them with cfg.ColorSet(scheme, set) on the configurator, see the Colors tutorial.

Fields

FieldDescription
M0 to M9Main source color and its shades.
A0 to A2Accent source color and its variants.
I0, I1Interactive source color and the button color.
Error, Warning, Good, InformativeSemantic colors.
Disabled, DisabledTextDisabled input areas and text on them.
PrimaryButtonTextText color on primary buttons.
Banner…Background, Banner…TextBackground and text colors of error, info, warning and success banners.

Methods

MethodDescription
Default(scheme core.ColorScheme) core.ColorSetReturns fallback colors; the real defaults are computed by the theme system.
Namespace() core.NamespaceNameReturns the reserved namespace ora.
Valid() boolReports whether all main, accent, interactive, semantic and disabled colors are set.

Related