class Faker::Color
def color_name
-
(String)
-
def color_name fetch('color.name') end
def hex_color
-
(String)
-
def hex_color format('#%06x', (rand * 0xffffff)) end
def hsl_color
-
(Array(Float, Float, Float))
-
def hsl_color [sample((0..360).to_a), rand.round(2), rand.round(2)] end
def hsla_color
-
(Array(Float, Float, Float, Float))
-
def hsla_color hsl_color << rand.round(1) end
def rgb_color
-
(Array(Integer, Integer, Integer))
-
def rgb_color Array.new(3) { single_rgb_color } end
def single_rgb_color
- Private: -
def single_rgb_color sample((0..255).to_a) end