Faker.Color (Faker v0.16.0) View Source

Functions for generating different color representations.

Link to this section Summary

Functions

Return a random fancy color name

Return a random color name

Return random RGB decimal value.

Return random RGB hex value.

Link to this section Functions

Specs

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"

Specs

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"

Specs

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}

Specs

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"