struct Tessell::Render::Theme

Defined in:

tessell/render/theme.cr

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.dark : Theme #

[View source]
def self.light : Theme #

[View source]
def self.new(bg : UInt32, fg : UInt32, accent : UInt32, muted : UInt32, border : UInt32, selection : UInt32, panel : UInt32, panel_alt : UInt32, card : UInt32, grid : UInt32, divider : UInt32, up : UInt32, down : UInt32, up_soft : UInt32, down_soft : UInt32, hover : UInt32, focus_ring : UInt32, warning : UInt32, danger : UInt32, success : UInt32, faint : UInt32) #

全参构造:显式给出所有 token。


[View source]
def self.new(bg : UInt32, fg : UInt32, accent : UInt32, muted : UInt32, border : UInt32, selection : UInt32) #

兼容构造(M3-WP5 口径):只给基础六元,扩展 token 按规则推导。


[View source]

Class Method Detail

def self.a(c : UInt32) : Float32 #

[View source]
def self.ab(c : UInt32) : UInt8 #

[View source]
def self.b(c : UInt32) : Float32 #

[View source]
def self.bb(c : UInt32) : UInt8 #

[View source]
def self.g(c : UInt32) : Float32 #

[View source]
def self.gb(c : UInt32) : UInt8 #

[View source]
def self.mix(a : UInt32, b : UInt32, t : Float32) : UInt32 #

线性插值(rgb 插值,alpha 取 a 的 alpha)。


[View source]
def self.r(c : UInt32) : Float32 #

归一化通道(0..1,任务要求的静态取通道方法)。


[View source]
def self.rb(c : UInt32) : UInt8 #

通道拆解(0xRRGGBBAA → 0..255)。


[View source]
def self.with_alpha(c : UInt32, alpha : UInt8) : UInt32 #

替换 alpha 通道。


[View source]

Instance Method Detail

def accent : UInt32 #

[View source]
def bg : UInt32 #

[View source]
def border : UInt32 #

[View source]
def card : UInt32 #

[View source]
def danger : UInt32 #

[View source]
def divider : UInt32 #

[View source]
def down : UInt32 #

[View source]
def down_soft : UInt32 #

[View source]
def faint : UInt32 #

[View source]
def fg : UInt32 #

[View source]
def focus_ring : UInt32 #

[View source]
def grid : UInt32 #

[View source]
def hover : UInt32 #

[View source]
def muted : UInt32 #

[View source]
def panel : UInt32 #

[View source]
def panel_alt : UInt32 #

[View source]
def selection : UInt32 #

[View source]
def success : UInt32 #

[View source]
def up : UInt32 #

[View source]
def up_soft : UInt32 #

[View source]
def warning : UInt32 #

[View source]