class Object

Public Instance Methods

rgbify(hex) click to toggle source
# File lib/rgbify.rb, line 24
def rgbify(hex)
        if hex[0] == "#" && hex.length == 7
                x = hex[1..-1]
                array = []
                x = x.scan(/.{2}/)
                x.each do |y|
                        array << y.hex
                end
                return RGB.new(array)
        else
                raise "Please Input valid Hexcode i.e. #ffffff"
        end
end