Hi. I am trying to write a simple program that takes a rgb value and changes the background to that color using Shoes (Raisins revision 1134). Here is my code:
Shoes.app :title => "Show a Color" do
def convert_to_num(value)
# Splits string into numerical values
value.split(',').map { |num| num.to_i }
end
def to_rgb(value)
red, green, blue = convert_to_num(value)
rgb(red, green, blue)
end
stack :height => 500, :width => 500 do
value = edit_line
button "Change color!" do
background to_rgb(value)
end
end
end
When I run it, I get this error: private method 'split' called for (Shoes::EditLine):Shoes::EditLine. Why is this? The method works in irb.