colorfast: Fast Conversion of R Colors to Color Component Values and Native Packed Integer Format

Color values in R are often represented as strings of hexadecimal colors or named colors. This package offers fast conversion of these color representations to either an array of red/green/blue/alpha values or to the packed integer format used in native raster objects. Functions for conversion are also exported at the 'C' level for use in other packages. This fast conversion of colors is implemented using an order-preserving minimal perfect hash derived from Majewski et al (1996) "A Family of Perfect Hashing Methods" <doi:10.1093/comjnl/39.6.547>.

Getting started

Package details

AuthorMike Cheng [aut, cre, cph]
MaintainerMike Cheng <mikefc@coolbutuseless.com>
LicenseMIT + file LICENSE
Version1.0.1
URL https://github.com/coolbutuseless/colorfast
Package repositoryView on CRAN
Installation Install the latest version of this package by entering the following in R:
install.packages("colorfast")

Try the colorfast package in your browser

Any scripts or data that you put into this service are public.

colorfast documentation built on April 4, 2025, 1:03 a.m.