In Files

Class/Module Index [+]

Quicksearch

Sickill::Rainbow

Attributes

enabled[RW]

Public Instance Methods

background(*color) click to toggle source

Sets background color of this text.

# File lib/rainbow.rb, line 38
def background(*color)
  color = color.first if color.size == 1
  wrap_with_code(get_color_code(color, :background))
end
bright() click to toggle source

Turns on bright/bold for this text.

# File lib/rainbow.rb, line 51
def bright
  wrap_with_code(TERM_EFFECTS[:bright])
end
color(*color) click to toggle source
Alias for: foreground
colour(*color) click to toggle source
Alias for: foreground
foreground(*color) click to toggle source

Sets foreground color of this text.

# File lib/rainbow.rb, line 29
def foreground(*color)
  color = color.first if color.size == 1
  wrap_with_code(get_color_code(color, :foreground))
end
Also aliased as: color, colour
hide() click to toggle source

Hides this text (set its color to the same as background).

# File lib/rainbow.rb, line 76
def hide
  wrap_with_code(TERM_EFFECTS[:hide])
end
inverse() click to toggle source

Inverses current foreground/background colors.

# File lib/rainbow.rb, line 71
def inverse
  wrap_with_code(TERM_EFFECTS[:inverse])
end
italic() click to toggle source

Turns on italic style for this text (not well supported by terminal emulators).

# File lib/rainbow.rb, line 56
def italic
  wrap_with_code(TERM_EFFECTS[:italic])
end
reset() click to toggle source

Resets terminal to default colors/backgrounds.

It shouldn’t be needed to use this method because all methods append terminal reset code to end of string.

# File lib/rainbow.rb, line 46
def reset
  wrap_with_code(TERM_EFFECTS[:reset])
end
underline() click to toggle source

Turns on underline decoration for this text.

# File lib/rainbow.rb, line 61
def underline
  wrap_with_code(TERM_EFFECTS[:underline])
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.