Description Usage Arguments Details Value
View source: R/lofi-hexcolour.R
Quantize a character vector of hex colours into a lofi (reduced bit) representation, and output this as a vector of integers.
1 2 3 | hex_colour_to_lofi(cols, rgb_bits)
lofi_to_hex_colour(lofi, rgb_bits)
|
cols |
character vector of hex colours e.g. |
rgb_bits |
3-element vector with number of bits to represent each of the 3 colour channels. Each element must be in the range [1,8] |
lofi |
vector of integers. Each integer contains a low-bit representation of a colour. |
A hex colour (e.g. '#ffaa70'
) is a character representation of a 24-bit colour i.e. 3 colour channels, each
represented by an 8 bit number.
lofi colour is a representation of a colour using a low number of bits for each colour channel, and then packed as an integer.
See wikipedia articles:
Return integer vector. Each integer represents a colour.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.