class RatatuiRuby::Style::Style

Defines colors and text modifiers.

The terminal is traditionally monochrome, but efficient interfaces use color to convey meaning. Red for errors. Green for success. Bold for headers.

This value object encapsulates those choices. It applies foreground and background colors. It adds effects like italics or blinking.

Use it to theme your application or highlight critical data.

Examples

# Standard colors
Style::Style.new(fg: :red, bg: :white, modifiers: [:bold])

# Hex colors
Style::Style.new(fg: "#ff00ff")

Supported Colors

Integer

Represents an indexed color from the Xterm 256-color palette (0-255).

Symbol

Represents a named color from the standard ANSI palette. Supported values:

String

Represents a specific RGB color using a Hex code ("#RRGGBB"). Requires a terminal emulator with ā€œTrue Colorā€ (24-bit color) support.