A simple Swift library allowing for the easy creation and manipulation of colors throughout various colorspaces.
This library is made available as a Swift Package. To use it as a dependency in your project see this documentation from Apple.
RGBColor
,HSLColor
,HSBColor
classes for easy creation of whatever colors you like.- Built-in conversions in all of the above classes, as well as to Hex strings &
UIColor
objects. - Convenience
distance
function to calculate the euclidean distance between any twoRGBColors
. - Color scheme generation functions, allowing you to create the following types of schemes for any
RGBColor
,HSLColor
orHSBColor
:- Monochromatic
- Complimentary
- Split-Complimentary
- Analogous
- Triadic
- Tetradic
For more information on the theory behind this library, check out this page on Color Models, and this page for more detailed information on the colorspaces used in this library and the conversion math involved.