class WindowTerminal::ColoredWrappedText

A subclass of WrappedText which adds compatibility for different colors.

Public Class Methods

new(orientation,text,y,color=:green,mode=:destroy) click to toggle source

Initializes a ColoredWrappedText object.

Calls superclass method WindowTerminal::WrappedText::new
# File lib/accu-window.rb, line 325
def initialize(orientation,text,y,color=:green,mode=:destroy)
        @color = color
        if WindowTerminal.os == :linux then
                if @color == :green then
                        text = "\e[#{32}m#{text}\e[0m"
                elsif @color == :red then
                        text = "\e[#{31}m#{text}\e[0m"
                elsif @color == :yellow then
                        text = "\e[#{33}m#{text}\e[0m"
                elsif @color == :pink then
                        text = "\e[#{35}m#{text}\e[0m"
                end
        end
        super(orientation,text,y,mode)
end