thomasp85 / farver

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

Provide something like scales::show_col() ? #24

Open hadley opened 3 years ago

hadley commented 3 years ago

Because it's v. nice to have someway to actually see the colours that you're playing with.

thomasp85 commented 3 years ago

I think I decided that prismatic was that thing and I didn't have to build it

ericmelse commented 2 months ago

Dear Thomas, Hadley,

While exploring farver and having the same need mentioned by Hadley, I provide just this code as an example:

install.packages('farver', dependencies = TRUE) ## High Performance Colour Space Manipulation
install.packages('prismatic', dependencies = TRUE) ## https://github.com/EmilHvitfeldt/prismatic
library(farver)
library(prismatic)
h <- decode_colour(heat.colors(15)) ## farver
h
hex_h <- encode_colour(h) ## farver
hex_h
heat_colors <- color(hex_h) ## prismatic
heat_colors
plot(heat_colors) ## prismatic

which results in: R_Figure_heat_colors