View Source Faker.Color (Faker v0.19.0-alpha.1)

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

fancy_name()

@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"

name()

@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"

rgb_decimal()

@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}

rgb_hex()

@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"