Class: Kolor::Enum::Theme

Inherits:
Kolor::Enum show all
Defined in:
lib/kolor/enum/theme.rb

Overview

Kolor::Enum::Theme defines named color themes for terminal output. Each theme is a structured hash containing:

- foreground: the main text color
- background: optional background color
- styles: optional array of text styles (e.g. :bold, :underline)

These themes are used to apply consistent formatting across messages, and can be extended or overridden via Kolor::Extra.theme.

Examples:

Kolor::Enum::Theme[:success].value
# => { foreground: :green, background: nil, styles: [:bold] }

Instance Attribute Summary

Attributes inherited from Kolor::Enum

#value

Instance Method Summary collapse

Methods inherited from Kolor::Enum

#==, [], all, entry, #hash, #initialize, #inspect, keys, name_for, remove, #to_s, #to_sym, type, values

Constructor Details

This class inherits a constructor from Kolor::Enum

Instance Method Details

#debugKolor::Enum::Theme

Returns magenta text for debugging output.

Returns:



31
# File 'lib/kolor/enum/theme.rb', line 31

entry :debug,   { foreground: :magenta, background: nil, styles: [] }

#errorKolor::Enum::Theme

Returns white text on red background for errors.

Returns:



22
# File 'lib/kolor/enum/theme.rb', line 22

entry :error,   { foreground: :white, background: :red, styles: [:bold] }

#infoKolor::Enum::Theme

Returns cyan text for informational messages.

Returns:



28
# File 'lib/kolor/enum/theme.rb', line 28

entry :info,    { foreground: :cyan, background: nil, styles: [] }

#successKolor::Enum::Theme

Returns green bold text for success messages.

Returns:



19
# File 'lib/kolor/enum/theme.rb', line 19

entry :success, { foreground: :green, background: nil, styles: [:bold] }

#warningKolor::Enum::Theme

Returns yellow bold text for warnings.

Returns:



25
# File 'lib/kolor/enum/theme.rb', line 25

entry :warning, { foreground: :yellow, background: nil, styles: [:bold] }