module

TUI

Class methods

color(r : Int32, g : Int32, b : Int32) : Color
Source
color(name : Symbol) : Color

The single call-site-facing color constructor — dispatches on argument shape so callers never construct a Color subclass directly: TUI.color(:red) -> NamedColor TUI.color(208) -> RGB256 (raw palette index) TUI.color(r: 5, g: 2, b: 0) -> RGB256 via Colors.cube TUI.color(gray: 10) -> RGB256 via Colors.gray

Source
color(index : Int32) : Color
Source
color(*, gray : Int32) : Color

*, forces this overload to match only a labeled gray: call — Crystal does not disambiguate Int32 overloads by parameter name for a plain positional argument, so without this a bare TUI.color(n) could resolve to either this or the index overload above.

Source

Nested types