5 lines
87 B
Ruby
5 lines
87 B
Ruby
def to_hex(r, g, b)
|
|
[r, g, b].sum('#') do |n|
|
|
n.to_s(16).rjust(2, '0')
|
|
end
|
|
end
|