colour_hash v0.1.0 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") {274, 0.65, 0.65} iex> ColourHash.hsl("test", %{lightness: [0.1], saturation: [0.3, 0.9], hue_range: %{min: 50, max: 330} } ) {274, 0.3, 0.1}
String hashed to colour rgb tuple string
iex> ColourHash.rgb("test")
{24, 108, 224}
iex> ColourHash.rgb("test", %{lightness: [0.1], saturation: [0.3, 0.9], hue_range: %{min: 50, max: 330} } )
{24, 18, 33}
Link to this section Functions
Link to this function
hex(string, options \\ %{lightness: [0.35, 0.5, 0.65], saturation: [0.35, 0.5, 0.65], hue_range: %{max: 360, min: 0}})
String hashed to colour hex string
Examples
iex> ColourHash.hex("test")
"186CE0"
iex> ColourHash.hex("test", %{lightness: [0.1], saturation: [0.1, 0.9], hue_range: %{min: 30, max: 30} } )
"18171C"
Link to this function
hsl(string, options \\ %{lightness: [0.35, 0.5, 0.65], saturation: [0.35, 0.5, 0.65], hue_range: %{max: 360, min: 0}})
String hashed to colour hsl tuple string iex> ColourHash.hsl("test") {274, 0.65, 0.65} iex> ColourHash.hsl("test", %{lightness: [0.1], saturation: [0.3, 0.9], hue_range: %{min: 50, max: 330} } ) {274, 0.3, 0.1}
Link to this function
rgb(string, options \\ %{lightness: [0.35, 0.5, 0.65], saturation: [0.35, 0.5, 0.65], hue_range: %{max: 360, min: 0}})
String hashed to colour rgb tuple string
iex> ColourHash.rgb("test")
{24, 108, 224}
iex> ColourHash.rgb("test", %{lightness: [0.1], saturation: [0.3, 0.9], hue_range: %{min: 50, max: 330} } )
{24, 18, 33}