RMGui 0.15.0
C11 retained-mode UI library: layout kernel, style schema, widget painters, fonts, software framebuffer
Loading...
Searching...
No Matches
style_palette.h File Reference
#include "style.h"

Data Structures

struct  rmgui_style_palette_ref_t
 SLOT requires slot < 16; LITERAL and ROLE require slot = 0. More...
struct  rmgui_style_palette_refs_t
 Role-indexed identities retained separately from scalar token references. More...
struct  rmgui_style_palette_t
 Caller-owned palette. More...

Macros

#define RMGUI_STYLE_PALETTE_SLOT_COUNT   16u
 Number of fixed Base16 slots, base00 through base0f.

Enumerations

enum  rmgui_style_color_role_t {
  RMGUI_STYLE_ROLE_BACKGROUND , RMGUI_STYLE_ROLE_PANEL , RMGUI_STYLE_ROLE_RAISED , RMGUI_STYLE_ROLE_HOVER ,
  RMGUI_STYLE_ROLE_PRESSED , RMGUI_STYLE_ROLE_TEXT , RMGUI_STYLE_ROLE_TEXT_MUTED , RMGUI_STYLE_ROLE_BORDER ,
  RMGUI_STYLE_ROLE_BORDER_STRONG , RMGUI_STYLE_ROLE_ACCENT , RMGUI_STYLE_ROLE_FOCUS , RMGUI_STYLE_ROLE_COUNT
}
 Fixed palette roles, in mask and reference-array order. More...
enum  rmgui_style_palette_ref_kind_t { RMGUI_STYLE_PALETTE_LITERAL , RMGUI_STYLE_PALETTE_SLOT , RMGUI_STYLE_PALETTE_ROLE }
 Literal keeps the snapshot colour; slot and role evaluate a palette binding. More...

Functions

int rmgui_style_palette_builtin (rmgui_style_scheme_t scheme, rmgui_style_palette_t *out)
 Copy a built-in scheme's ordinary, editable palette: fixed RMGui-derived Base16 slots, every role and syntax overlay, without a codec dependency.
int rmgui_style_palette_apply (rmgui_style_snapshot_t *snapshot, const rmgui_style_palette_t *palette, const rmgui_style_palette_refs_t *refs)
 Evaluate nonliteral bindings, preserving class rows/token_ref.
int rmgui_style_palette_syntax (const rmgui_style_palette_t *palette, rmgui_style_syntax_t role, rmgui_color_t *out)
 Get an overlay or fixed fallback-slot syntax colour; plain is effective text.

Macro Definition Documentation

◆ RMGUI_STYLE_PALETTE_SLOT_COUNT

#define RMGUI_STYLE_PALETTE_SLOT_COUNT   16u

Number of fixed Base16 slots, base00 through base0f.

Enumeration Type Documentation

◆ rmgui_style_color_role_t

Fixed palette roles, in mask and reference-array order.

BACKGROUND is the opaque content surface: windows, dialogs, menus, popups, tooltips, documents and unselected list rows. TEXT is the foreground ink. PANEL is secondary chrome (toolbars, tab strips, scroll tracks); RAISED is a resting control face. HOVER and PRESSED are interactive control states. TEXT_MUTED is secondary/disabled ink, never the default body text. BORDER separates surfaces; BORDER_STRONG emphasizes control edges. ACCENT marks selection/action; FOCUS marks keyboard focus.

Enumerator
RMGUI_STYLE_ROLE_BACKGROUND 
RMGUI_STYLE_ROLE_PANEL 
RMGUI_STYLE_ROLE_RAISED 
RMGUI_STYLE_ROLE_HOVER 
RMGUI_STYLE_ROLE_PRESSED 
RMGUI_STYLE_ROLE_TEXT 
RMGUI_STYLE_ROLE_TEXT_MUTED 
RMGUI_STYLE_ROLE_BORDER 
RMGUI_STYLE_ROLE_BORDER_STRONG 
RMGUI_STYLE_ROLE_ACCENT 
RMGUI_STYLE_ROLE_FOCUS 
RMGUI_STYLE_ROLE_COUNT 

◆ rmgui_style_palette_ref_kind_t

Literal keeps the snapshot colour; slot and role evaluate a palette binding.

Enumerator
RMGUI_STYLE_PALETTE_LITERAL 
RMGUI_STYLE_PALETTE_SLOT 
RMGUI_STYLE_PALETTE_ROLE 

Function Documentation

◆ rmgui_style_palette_builtin()

int rmgui_style_palette_builtin ( rmgui_style_scheme_t scheme,
rmgui_style_palette_t * out )

Copy a built-in scheme's ordinary, editable palette: fixed RMGui-derived Base16 slots, every role and syntax overlay, without a codec dependency.

The copy owns its data; edits do not affect the built-in example. Invalid scheme/out returns -1 without changing out; success is 0.

◆ rmgui_style_palette_apply()

int rmgui_style_palette_apply ( rmgui_style_snapshot_t * snapshot,
const rmgui_style_palette_t * palette,
const rmgui_style_palette_refs_t * refs )

Evaluate nonliteral bindings, preserving class rows/token_ref.

Set scheme to DEFAULT; validate and commit transactionally. Required NULL/invalid refs or masks return -1; success is 0. Inputs are borrowed during the call.

◆ rmgui_style_palette_syntax()

int rmgui_style_palette_syntax ( const rmgui_style_palette_t * palette,
rmgui_style_syntax_t role,
rmgui_color_t * out )

Get an overlay or fixed fallback-slot syntax colour; plain is effective text.

Invalid arguments/masks return -1 with out unchanged; success is 0.