Learn R Programming

colorfast (version 1.0.1)

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

Description

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" .

Copy Link

Version

Install

install.packages('colorfast')

Monthly Downloads

288

Version

1.0.1

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Mike Cheng

Last Published

January 13th, 2025

Functions in colorfast (1.0.1)

col_to_int

Fast conversion of colors-as-strings to an integer vector of packed RGBA values.
set_alpha

Set alpha value of integer colors
int_to_col

Fast conversion of colors-as-packed-RGBA-integers to hexadecimal
col_to_rgb

Fast conversion of colors-as-strings to a matrix of RGBA integers