View Source Faker.Color (Faker v0.18.0)

Functions for generating different color representations.

Summary

Functions

Return a random fancy color name

Return a random color name

Return random RGB decimal value.

Return random RGB hex value.

Functions

@spec fancy_name() :: String.t()

Return a random fancy color name

Examples

iex> Faker.Color.fancy_name()
"Tawny"
iex> Faker.Color.fancy_name()
"Citrine"
iex> Faker.Color.fancy_name()
"Greige"
iex> Faker.Color.fancy_name()
"Cesious"
@spec name() :: String.t()

Return a random color name

Examples

iex> Faker.Color.name()
"Red"
iex> Faker.Color.name()
"Green"
iex> Faker.Color.name()
"Brown"
iex> Faker.Color.name()
"Pink"
@spec rgb_decimal() :: {byte(), byte(), byte()}

Return random RGB decimal value.

Examples

iex> Faker.Color.rgb_decimal()
{214, 217, 139}
iex> Faker.Color.rgb_decimal()
{136, 200, 102}
iex> Faker.Color.rgb_decimal()
{244, 150, 219}
iex> Faker.Color.rgb_decimal()
{212, 222, 123}
@spec rgb_hex() :: binary()

Return random RGB hex value.

Examples

iex> Faker.Color.rgb_hex()
"D6D98B"
iex> Faker.Color.rgb_hex()
"88C866"
iex> Faker.Color.rgb_hex()
"F496DB"
iex> Faker.Color.rgb_hex()
"D4DE7B"