Module: HexHelper
Instance Method Summary collapse
Instance Method Details
#rgb_sample ⇒ Object
8 9 10 |
# File 'lib/rails_com/utils/hex_helper.rb', line 8 def rgb_sample "##{sample}" end |
#sample ⇒ Object
4 5 6 |
# File 'lib/rails_com/utils/hex_helper.rb', line 4 def sample [rand(0..255), rand(0..255), rand(0..255)].map { |i| i.to_s(16).rjust(2, '0') }.join end |