class Color::Schemes
class containing all colour manipulation functions, and variables
Public Class Methods
new(filepath = "None")
click to toggle source
colour schemes. namespaced under Color
. these are essentially the same functions as above, but storing multiple colours in the hash
# File lib/artsy/colour.rb, line 14 def initialize(filepath = "None") # create a new colour scheme @scheme = Hash.new end
Public Instance Methods
out(text, colour)
click to toggle source
# File lib/artsy/colour.rb, line 24 def out(text, colour) # print using a scheme colour puts "#{@scheme[colour]}#{text}\033[0m" end
setSColor(name, r, g, b)
click to toggle source
# File lib/artsy/colour.rb, line 19 def setSColor(name, r, g, b) # set scheme colour @scheme["#{name}"] = "\033[38;2;#{r};#{g};#{b}m" end