thomasp85 / farver

High Performance Colourspace Manipulation in R
https://farver.data-imaginist.com
Other
125 stars 14 forks source link

Feature: encode_colour() and _native() allow na_value #38

Open zeehio opened 1 year ago

zeehio commented 1 year ago

Built on top of #37 and #36 (please review those first), this pull request allows for encode_colour() to pass a na_value.

Besides being a convenience feature, it also enables me to reduce passes or creating copies of larger vectors.

I am aiming to improve performance in how scale mapping works in ggplot2 with larger vectors. Related to https://github.com/tidyverse/ggplot2/issues/4989