Colour space conversionThis is the raison d’être of the package. Take a matrix or data frame with colour channels in the columns, and convert it from one colour space to another. Channels are automatically capped if they have defined bounds, and any |
|
---|---|
Convert between colour spaces |
|
Colour comparisonGetting a numeric value describing the distance between two colours is not a trivial task, and several metrics have been devised for that. farver supports a range of these, and allows you to compare colours in any space with each others. |
|
Calculate the distance between colours |
|
Converting to and from colour stringsThe native format of colours in R (and other languages) is often hexadecimal encoded rgb values ( |
|
Encode colours into RGB hex-strings |
|
Decode RGB hex-strings into colour values |
|
Colour string manipulationAs colours are often encoded as strings, manipulation of individual channels requires decoding. and then encoding. farver does away with that by providing a range of functions for directly manipulating channels in colour strings. |
|
|
Modify colour space channels in hex-encoded colour strings |
Converting to and from native colour representationUnder the hood, R encodes colours as integers, with the 32 bit in the integer divided beetween red, green, blue, and alpha, giving them 8 bit (or 256 values) each. farver provides a simple and fast way of converting between the native integer representation and the string representation. |
|
Convert to and from the R native colour representation |