Class: Carbuncle::Color
Constant Summary
Vectorizable::CLASS
Constants included
from Enumerable
Enumerable::NONE
Class Method Summary
collapse
Instance Method Summary
collapse
vectorize_properties
#%, #*, #**, #+, #-, #-@, #/, #<<, #>>, #[], #[]=, #each, #length, #to_s
Methods included from Enumerable
__update_hash, #all?, #any?, #chain, #collect, #count, #cycle, #detect, #drop, #drop_while, #each_cons, #each_slice, #each_with_index, #each_with_object, #entries, #filter_map, #find_all, #find_index, #first, #flat_map, #grep, #group_by, #hash, #include?, #inject, #lazy, #max, #max_by, #min, #min_by, #minmax, #minmax_by, #none?, #one?, #partition, #reject, #reverse_each, #sort, #sort_by, #sum, #take, #take_while, #tally, #to_h, #uniq, #zip
Class Method Details
8
9
10
|
# File 'gems/carbuncle-graphics/mrblib/color.rb', line 8
def random
new(rand(255), rand(255), rand(255))
end
|
Instance Method Details
13
14
15
|
# File 'gems/carbuncle-graphics/mrblib/color.rb', line 13
def inspect
"Color(#{r}, #{g}, #{b}, #{a})"
end
|
17
18
19
|
# File 'gems/carbuncle-graphics/mrblib/color.rb', line 17
def size
4
end
|
21
22
23
|
# File 'gems/carbuncle-graphics/mrblib/color.rb', line 21
def to_a
[r, g, b, a]
end
|