View Source MotleyHue (Mötley Hüe v0.2.1)
An Elixir utility for calculating the following color combinations:
- Complimentary - Two colors that are on opposite sides of the color wheel
- Analagous - Three colors that are side by side on the color wheel
- Monochromatic - A spectrum of shades, tones and tints of one base color
- Triadic - Three colors that are evenly spaced on the color wheel
- Tetradic - Four colors that are evenly spaced on the color wheel
Link to this section Summary
Functions
Returns the provided color and its two analagous (adjacent) colors along a given direction of the HSV color wheel. Adjacency is defined by a 30° offset in hue value and an analogous set must reside within a 90° section of the color wheel.
Returns the provided color and its compliment.
Note that complimentary color can be calculated by either taking the value 180° (i.e., opposite) from the hue value on the HSV color wheel
or by finding the RGB value that when combined with the provided color will yield white (i.e., rgb(255, 255, 255)).
The default approach is to use the HSV hue offset, but either can be calculated by passing :hsv
or :rgb
as the model argument.
Returns the provided color and the requested count of additional colors evenly spaced along the color wheel.
Returns the provided color and its monochromatic color spectrum towards black. The number of results is configurable with each color equally spaced from the previous value.
Returns the provided color and its three tetradic colors, which are the colors 90°, 180°, and 270° offset from the given color's hue value on the HSV color wheel.
Returns the provided color and its two triadic colors, which are the colors 120° and 240° offset from the given color's hue value on the HSV color wheel.
Link to this section Functions
Specs
Returns the provided color and its two analagous (adjacent) colors along a given direction of the HSV color wheel. Adjacency is defined by a 30° offset in hue value and an analogous set must reside within a 90° section of the color wheel.
Examples
iex> MotleyHue.analagous("FF0000")
["FF0000", "FF8000", "FFFF00"]
iex> MotleyHue.analagous("FF0000", :counter_clockwise)
["FF0000", "FF0080", "FF00FF"]
Specs
Returns the provided color and its compliment.
Note that complimentary color can be calculated by either taking the value 180° (i.e., opposite) from the hue value on the HSV color wheel
or by finding the RGB value that when combined with the provided color will yield white (i.e., rgb(255, 255, 255)).
The default approach is to use the HSV hue offset, but either can be calculated by passing :hsv
or :rgb
as the model argument.
Examples
iex> MotleyHue.complimentary("FF0000")
["FF0000", "00FFFF"]
iex> MotleyHue.complimentary("008080", :hsv)
["008080", "800000"]
iex> MotleyHue.complimentary("008080", :rgb)
["008080", "FF7F7F"]
Specs
Returns the provided color and the requested count of additional colors evenly spaced along the color wheel.
Examples
iex> MotleyHue.even("FF0000", 5)
["FF0000", "CCFF00", "00FF66", "0066FF", "CC00FF"]
Specs
Returns the provided color and its monochromatic color spectrum towards black. The number of results is configurable with each color equally spaced from the previous value.
Examples
iex> MotleyHue.monochromatic("FF0000")
["FF0000", "AB0000", "570000"]
iex> MotleyHue.monochromatic("FF0000", 5)
["FF0000", "CC0000", "990000", "660000", "330000"]
Specs
Returns the provided color and its three tetradic colors, which are the colors 90°, 180°, and 270° offset from the given color's hue value on the HSV color wheel.
Examples
iex> MotleyHue.tetradic("FF0000")
["FF0000", "80FF00", "00FFFF", "8000FF"]
Specs
Returns the provided color and its two triadic colors, which are the colors 120° and 240° offset from the given color's hue value on the HSV color wheel.
Examples
iex> MotleyHue.triadic("FF0000")
["FF0000", "00FF00", "0000FF"]