struct UI::DesignTokens::ColorPalette

Overview

23 semantic color roles. The set is the union of the Material 3 roles already in UI::Theme and the surface/text/border/state set in the Components::CSS::Tokens::Theme web token bag. Names use library-generic vocabulary, not platform vocabulary.

Defined in:

ui/design_tokens.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(brand_primary : Color, brand_primary_hover : Color, brand_primary_active : Color, brand_secondary : Color, brand_accent : Color, surface_canvas : Color, surface_panel : Color, surface_elevated : Color, surface_sunken : Color, surface_inverse : Color, text_primary : Color, text_secondary : Color, text_muted : Color, text_inverse : Color, text_link : Color, border_subtle : Color, border_default : Color, border_strong : Color, border_focus : Color, success : Color, warning : Color, danger : Color, info : Color) #

[View source]

Instance Method Detail

def border_default : Color #

def border_focus : Color #

def border_strong : Color #

def border_subtle : Color #

def brand_accent : Color #

def brand_primary : Color #

def brand_primary_active : Color #

def brand_primary_hover : Color #

def brand_secondary : Color #

def clone #

[View source]
def copy_with(brand_primary _brand_primary = @brand_primary, brand_primary_hover _brand_primary_hover = @brand_primary_hover, brand_primary_active _brand_primary_active = @brand_primary_active, brand_secondary _brand_secondary = @brand_secondary, brand_accent _brand_accent = @brand_accent, surface_canvas _surface_canvas = @surface_canvas, surface_panel _surface_panel = @surface_panel, surface_elevated _surface_elevated = @surface_elevated, surface_sunken _surface_sunken = @surface_sunken, surface_inverse _surface_inverse = @surface_inverse, text_primary _text_primary = @text_primary, text_secondary _text_secondary = @text_secondary, text_muted _text_muted = @text_muted, text_inverse _text_inverse = @text_inverse, text_link _text_link = @text_link, border_subtle _border_subtle = @border_subtle, border_default _border_default = @border_default, border_strong _border_strong = @border_strong, border_focus _border_focus = @border_focus, success _success = @success, warning _warning = @warning, danger _danger = @danger, info _info = @info) #

[View source]
def danger : Color #

def info : Color #

def lookup(role : Symbol) : Color | Nil #

Lookup by symbol (used by renderer token helpers).


[View source]
def success : Color #

def surface_canvas : Color #

def surface_elevated : Color #

def surface_inverse : Color #

def surface_panel : Color #

def surface_sunken : Color #

def text_inverse : Color #

def text_link : Color #

def text_muted : Color #

def text_primary : Color #

def text_secondary : Color #

def to_h : Hash(String, Color) #

Iterating accessor used by generators and #lookup. Keys use the same kebab vocabulary that ships in the CSS output (brand-primary, etc.).


[View source]
def warning : Color #