thomasp85 / farver

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

encode_colour accepts a list besides a matrix #36

Open zeehio opened 1 year ago

zeehio commented 1 year ago

This pull request lets encode_colour() accept a list or a data frame instead of a colour matrix.

This has performance improvements when each channel is computed independently, because instead of cbind()-ing them together we can list() them, avoiding the allocation of a larger matrix.

This is a first subset of #35, aiming to improve performance in farver with larger vectors. It is part of https://github.com/tidyverse/ggplot2/issues/4989, to improve the performance of rasterizing large matrices.

No breaking changes are introduced.

Each commit can be reviewed independently.

Thanks for your time

zeehio commented 1 year ago

Hi @thomasp85

No hurries. It is not my intention to put any pressure on you.

As you know, I contributed several pull requests for farver. In case they are of interest to you and you plan to eventually review them I would appreciate to know in advance when you are planning to do it (e.g. on the first week of September I'd appreciate if you would tell me "in two weeks I'll look into some of them").

I understand how hard it is to find time for these things and possible I would like to have some time available when you do, so I can reply as fast as possible during your time slot.

It does not need to be this month or even this quarter. I don't want to push or mess with anyone's agenda, I just would like to do my best to align my time to your availability.

Thanks for all your work!