struct

FFF::Theme

Inherits Struct < Value < Object

Theme — Central color management for all TUI rendering. Replaces hardcoded Term::Color symbols with RGB truecolor values. Loaded from FFF_THEME env, config.json "theme", or defaults.

Constants

BUILTIN_THEMES = {"default" => Theme.new, "catppuccin-mocha" => Theme.new(topbar_bg: {30_u8, 30_u8, 46_u8}, topbar_fg: {205_u8, 214_u8, 244_u8}, status_bg: {24_u8, 24_u8, 37_u8}, status_fg: {186_u8, 194_u8, 222_u8}, selection_bg: {69_u8, 71_u8, 90_u8}, selection_fg: {205_u8, 214_u8, 244_u8}, bg: {30_u8, 30_u8, 46_u8}, fg: {205_u8, 214_u8, 244_u8}, accent: {137_u8, 180_u8, 250_u8}, marked: {249_u8, 226_u8, 175_u8}, error: {243_u8, 139_u8, 168_u8}, success: {166_u8, 227_u8, 161_u8}, warning: {249_u8, 226_u8, 175_u8}, info: {137_u8, 180_u8, 250_u8}, dir_color: {137_u8, 180_u8, 250_u8}, exec_color: {166_u8, 227_u8, 161_u8}, symlink_color: {245_u8, 194_u8, 231_u8}, dim: {108_u8, 112_u8, 134_u8}, border: {88_u8, 91_u8, 112_u8}, search_match: {249_u8, 226_u8, 175_u8}, git_added: {166_u8, 227_u8, 161_u8}, git_modified: {249_u8, 226_u8, 175_u8}, git_untracked: {148_u8, 226_u8, 213_u8}, git_deleted: {243_u8, 139_u8, 168_u8}, bookmark_bg: {24_u8, 24_u8, 37_u8}, bookmark_fg: {108_u8, 112_u8, 134_u8}, bookmark_active: {137_u8, 180_u8, 250_u8}, preview_border: {88_u8, 91_u8, 112_u8}, preview_header: {137_u8, 180_u8, 250_u8}, progress_fill: {137_u8, 180_u8, 250_u8}, progress_empty: {69_u8, 71_u8, 90_u8}), "gruvbox-dark" => Theme.new(topbar_bg: {40_u8, 40_u8, 40_u8}, topbar_fg: {235_u8, 219_u8, 178_u8}, status_bg: {29_u8, 32_u8, 33_u8}, status_fg: {213_u8, 196_u8, 161_u8}, selection_bg: {80_u8, 73_u8, 69_u8}, selection_fg: {251_u8, 241_u8, 199_u8}, bg: {40_u8, 40_u8, 40_u8}, fg: {235_u8, 219_u8, 178_u8}, accent: {131_u8, 165_u8, 152_u8}, marked: {250_u8, 189_u8, 47_u8}, error: {251_u8, 73_u8, 52_u8}, success: {184_u8, 187_u8, 38_u8}, warning: {250_u8, 189_u8, 47_u8}, info: {131_u8, 165_u8, 152_u8}, dir_color: {131_u8, 165_u8, 152_u8}, exec_color: {184_u8, 187_u8, 38_u8}, symlink_color: {211_u8, 134_u8, 155_u8}, dim: {146_u8, 131_u8, 116_u8}, border: {80_u8, 73_u8, 69_u8}, search_match: {250_u8, 189_u8, 47_u8}, git_added: {184_u8, 187_u8, 38_u8}, git_modified: {250_u8, 189_u8, 47_u8}, git_untracked: {131_u8, 165_u8, 152_u8}, git_deleted: {251_u8, 73_u8, 52_u8}, bookmark_bg: {29_u8, 32_u8, 33_u8}, bookmark_fg: {146_u8, 131_u8, 116_u8}, bookmark_active: {254_u8, 128_u8, 25_u8}, preview_border: {80_u8, 73_u8, 69_u8}, preview_header: {131_u8, 165_u8, 152_u8}, progress_fill: {254_u8, 128_u8, 25_u8}, progress_empty: {80_u8, 73_u8, 69_u8}), "nord" => Theme.new(topbar_bg: {46_u8, 52_u8, 64_u8}, topbar_fg: {236_u8, 239_u8, 244_u8}, status_bg: {59_u8, 66_u8, 82_u8}, status_fg: {229_u8, 233_u8, 240_u8}, selection_bg: {67_u8, 76_u8, 94_u8}, selection_fg: {236_u8, 239_u8, 244_u8}, bg: {46_u8, 52_u8, 64_u8}, fg: {216_u8, 222_u8, 233_u8}, accent: {136_u8, 192_u8, 208_u8}, marked: {235_u8, 203_u8, 139_u8}, error: {191_u8, 97_u8, 106_u8}, success: {163_u8, 190_u8, 140_u8}, warning: {235_u8, 203_u8, 139_u8}, info: {129_u8, 161_u8, 193_u8}, dir_color: {136_u8, 192_u8, 208_u8}, exec_color: {163_u8, 190_u8, 140_u8}, symlink_color: {180_u8, 142_u8, 173_u8}, dim: {76_u8, 86_u8, 106_u8}, border: {67_u8, 76_u8, 94_u8}, search_match: {235_u8, 203_u8, 139_u8}, git_added: {163_u8, 190_u8, 140_u8}, git_modified: {235_u8, 203_u8, 139_u8}, git_untracked: {136_u8, 192_u8, 208_u8}, git_deleted: {191_u8, 97_u8, 106_u8}, bookmark_bg: {59_u8, 66_u8, 82_u8}, bookmark_fg: {76_u8, 86_u8, 106_u8}, bookmark_active: {136_u8, 192_u8, 208_u8}, preview_border: {67_u8, 76_u8, 94_u8}, preview_header: {136_u8, 192_u8, 208_u8}, progress_fill: {136_u8, 192_u8, 208_u8}, progress_empty: {67_u8, 76_u8, 94_u8}), "dracula" => Theme.new(topbar_bg: {40_u8, 42_u8, 54_u8}, topbar_fg: {248_u8, 248_u8, 242_u8}, status_bg: {33_u8, 34_u8, 44_u8}, status_fg: {248_u8, 248_u8, 242_u8}, selection_bg: {68_u8, 71_u8, 90_u8}, selection_fg: {248_u8, 248_u8, 242_u8}, bg: {40_u8, 42_u8, 54_u8}, fg: {248_u8, 248_u8, 242_u8}, accent: {139_u8, 233_u8, 253_u8}, marked: {241_u8, 250_u8, 140_u8}, error: {255_u8, 85_u8, 85_u8}, success: {80_u8, 250_u8, 123_u8}, warning: {241_u8, 250_u8, 140_u8}, info: {139_u8, 233_u8, 253_u8}, dir_color: {189_u8, 147_u8, 249_u8}, exec_color: {80_u8, 250_u8, 123_u8}, symlink_color: {255_u8, 121_u8, 198_u8}, dim: {98_u8, 114_u8, 164_u8}, border: {68_u8, 71_u8, 90_u8}, search_match: {241_u8, 250_u8, 140_u8}, git_added: {80_u8, 250_u8, 123_u8}, git_modified: {241_u8, 250_u8, 140_u8}, git_untracked: {139_u8, 233_u8, 253_u8}, git_deleted: {255_u8, 85_u8, 85_u8}, bookmark_bg: {33_u8, 34_u8, 44_u8}, bookmark_fg: {98_u8, 114_u8, 164_u8}, bookmark_active: {189_u8, 147_u8, 249_u8}, preview_border: {68_u8, 71_u8, 90_u8}, preview_header: {189_u8, 147_u8, 249_u8}, progress_fill: {189_u8, 147_u8, 249_u8}, progress_empty: {68_u8, 71_u8, 90_u8})}

Constructors

load(name : String | Nil = nil, json : JSON::Any | Nil = nil) : Theme
Source

Class methods

fg(text : String, fore : RGB) : String

Render text with truecolor foreground only

Source
fg_bg(text : String, fore : RGB, back : RGB) : String

Render text with truecolor foreground and background

Source
fg_bg_bold(text : String, fore : RGB, back : RGB) : String

Render text with bold + truecolor foreground + background

Source
fg_bg_bold_underline(text : String, fore : RGB, back : RGB) : String

Render text with underline + truecolor foreground + background

Source
fg_bold(text : String, fore : RGB) : String

Render text with bold + truecolor foreground

Source
reset

Reset all attributes

Source
set_fg(fore : RGB) : String

Set truecolor foreground only (no reset)

Source
set_fg_bg(fore : RGB, back : RGB) : String

Set truecolor foreground + background (no reset, for building strings)

Source
set_fg_bg_bold_underline(fore : RGB, back : RGB) : String

Set underline + truecolor foreground + background (no reset)

Source
set_fg_bold(fore : RGB) : String

Set bold + truecolor foreground (no reset)

Source

Instance methods

accent
Source
bookmark_active
Source
bookmark_bg
Source
bookmark_fg
Source
border
Source
dir_color
Source
error
Source
exec_color
Source
git_added
Source
git_deleted
Source
git_modified
Source
git_untracked
Source
info
Source
marked
Source
preview_border
Source
preview_header
Source
progress_empty
Source
progress_fill
Source
search_match
Source
selection_bg
Source
selection_fg
Source
status_bg
Source
status_fg
Source
success
Source
topbar_bg
Source
topbar_fg
Source
warning
Source