colour_hash v1.0.3 ColourHash

Documentation for ColourHash.

Link to this section Summary

Functions

String hashed to colour hex string

String hashed to colour hsl tuple string
iex> ColourHash.hsl("test")
{268.88583218707015, 0.65, 0.65}
iex> ColourHash.hsl("test", lightness: [0.1], saturation: [0.3, 0.9], hue_range: %{min: 150, max: 330} )
{284.4429160935351, 0.3, 0.1}
String hashed to colour rgb tuple string
iex> ColourHash.rgb("test")
{164, 108, 224}
iex> ColourHash.rgb("test", lightness: [0.1], saturation: [0.3, 0.9], hue_range: %{min: 50, max: 330} )
{23, 18, 33}

Link to this section Functions

Link to this function

hex(string, options \\ [])

String hashed to colour hex string

Examples

iex> ColourHash.hex("test")
"A46CE0"
iex> ColourHash.hex("test", lightness: [0.1], saturation: [0.1, 0.9], hue_range: %{min: 30, max: 30} )
"1C1A17"
Link to this function

hsl(string, options \\ [])

String hashed to colour hsl tuple string
iex> ColourHash.hsl("test")
{268.88583218707015, 0.65, 0.65}
iex> ColourHash.hsl("test", lightness: [0.1], saturation: [0.3, 0.9], hue_range: %{min: 150, max: 330} )
{284.4429160935351, 0.3, 0.1}
Link to this function

rgb(string, options \\ [])

String hashed to colour rgb tuple string
iex> ColourHash.rgb("test")
{164, 108, 224}
iex> ColourHash.rgb("test", lightness: [0.1], saturation: [0.3, 0.9], hue_range: %{min: 50, max: 330} )
{23, 18, 33}