DVUI

Theme

Fields

#
name:[]const u8
[]const u8
dark:bool

widgets can use this if they need to adjust colors

focus:Color

used for focus highlighting

text_select:?Color

color used to show selected text. textLayout composites this color partially opaque under selected text.

fill:Color

fill for .content Style, fallback for any Style without fill. Example is background of textLayout and textEntry.

fill_hover:?Color

fill when hovered for .content Style. Example is hovering checkbox. If null, dvui creates one by adjusting fill (see adjustColorForState.

fill_press:?Color

fill when pressed for .content Style. Example is pressing checkbox. If null, dvui creates one by adjusting fill (see adjustColorForState.

ninepatch_fill:?dvui.Ninepatch

ninepatch for .content Style, fallback for any Style without fill.

ninepatch_hover:?dvui.Ninepatch

ninepatch when hovered for .content Style, fallback for any Style without fill.

ninepatch_press:?dvui.Ninepatch

ninepatch when pressed for .content Style, fallback for any Style without fill.

text:Color

text color for .content Style, fallback for any Style without text. Example is text in a textLayout or textEntry. Also used as general foreground color like a checkmark or icon color.

text_hover:?Color

text when hovered for .content Style. Currently unused in dvui widgets. If null, uses text.

text_press:?Color

text when pressed for .content Style. Currently unused in dvui widgets (but text_press in .control Style is). If null, uses text.

border:Color

border for .content Style, fallback for any Style without border.

control:Style

colors for normal controls like buttons

window:Style

colors for windows/boxes that contain controls like scrollArea and floatingWindow

highlight:Style

colors for highlighting:

err:Style

colors for buttons to perform dangerous actions

app1:Style

Reserved for application use. dvui only uses these in examples.

app2:Style
Style
app3:Style
Style
font_body:Font

Font for body text.

font_heading:Font

Usually a bold version of font_body.

font_title:Font

Usually a larger version of font_body.

font_mono:Font

Font for monospaced body text. dvui only uses this in examples.

corner:Corner

Default widget corner. Corner ".default" uses this. Corner ".theme" use

allocated_strings:bool

if true, all strings in Theme will be freed in deinit

embedded_fonts:[]const Font.Source

Font sources here will be loaded on demand by dvui when this theme is used.

Types

#
Style

Colors for controls (like buttons), if null fall back to theme colors and

Namespaces

#

Functions

#
color

Get the resolved color for a style. If null fallback to theme base.

adjustColorForState

Adjust col (sourced from .fill) for .fill_hover and .fill_press by

picker

To pick between the built in themes, pass &Theme.builtins as the themes argument

Constants

#
builtins

A comptime array of all the builtin themes sorted alphabetically