Method: String#background_color

Defined in:
lib/term/color.rb

#background_color(name) ⇒ String

string background color.

Examples:

background color

"mystring".background_color :black # keywords
"mystring".background_color 123 # 256 colors
"mystring".background_color '#000' # true color

Parameters:

  • name (Object)

    the background color name

Returns:

  • (String)

    the formatting string



226
227
228
229
# File 'lib/term/color.rb', line 226

def background_color(name)
  set_256_color(name, 48) || set_rbg_color(name, 48) ||
    set_keyword_color(name, '_background') || self
end