class FadeRuby::Pixel
Attributes
b[R]
g[R]
r[R]
Public Class Methods
new(r=0,g=0,b=0)
click to toggle source
# File lib/faderuby/pixel.rb, line 3 def initialize(r=0,g=0,b=0) @r = r @g = g @b = b end
Public Instance Methods
set(r: nil, g: nil, b: nil)
click to toggle source
# File lib/faderuby/pixel.rb, line 13 def set(r: nil, g: nil, b: nil) @r = r if r @g = g if g @b = b if b end
set_random()
click to toggle source
# File lib/faderuby/pixel.rb, line 19 def set_random @r = rand(255) @g = rand(255-@r) @b = rand(255-@r-@g) end
to_a()
click to toggle source
# File lib/faderuby/pixel.rb, line 9 def to_a [r,g,b] end