class RatatuiRuby::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.new(fg: :red, bg: :white, modifiers: [:bold]) # Hex colors Style.new(fg: "#ff00ff")
Attributes
Background color.
Symbol (:black) or Hex String ("#000000").
Foreground color.
Symbol (:red) or Hex String ("#ffffff").
Text effects.
Array of symbols: :bold, :dim, :italic, :underlined, :slow_blink, :rapid_blink, :reversed, :hidden, :crossed_out.
Public Class Methods
Source
# File lib/ratatui_ruby/schema/style.rb, line 55 def self.default new end
Returns an empty style.
Use this as a baseline to prevent style inheritance issues or when no styling is required.
Source
# File lib/ratatui_ruby/schema/style.rb, line 48 def initialize(fg: nil, bg: nil, modifiers: []) super end
Creates a new Style.
- fg
-
Color (Symbol/String).
- bg
-
Color (Symbol/String).
- modifiers
-
Array of Symbols.