Module: HexHelper

Extended by:
HexHelper
Included in:
HexHelper
Defined in:
lib/rails_com/utils/hex_helper.rb

Instance Method Summary collapse

Instance Method Details

#rgb_sampleObject



8
9
10
# File 'lib/rails_com/utils/hex_helper.rb', line 8

def rgb_sample
  "##{sample}"
end

#sampleObject



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