module RatatuiRuby::Style::Color

Color constructors for creating RGB color values.

Styles accept colors in multiple formats: symbols (:red), indexed integers (0-255), or hex strings ("#FF0000"). Converting from other color representations manually is tedious.

This module provides factory methods matching Ratatui’s Color API. Convert from hex integers, HSL, or other formats in a single call.

Use these constructors when you have color data in non-standard formats.

Example

# From a hex integer (common in design tools)
red = Style::Color.from_u32(0xFF0000)
style = Style::Style.new(fg: red)

# From HSL (common in color pickers)
blue = Style::Color.from_hsl(240, 100, 50)
style = Style::Style.new(bg: blue)