iynehz / perl5-Chart-GGPlot

ggplot port in Perl
13 stars 2 forks source link

gradient_n_pal to interpolate in the CIELab color space #12

Closed iynehz closed 1 year ago

iynehz commented 5 years ago

R's scales::gradient_n_pal() uses the Lab space. Now in Chart::GGPlot we use the RGB space. The two are somewhat different. This would affect the result scale_color/fill_gradient().

https://metacpan.org/pod/Graphics::ColorObject has functions for converting between RGB and Lab space. But this project is not maintained after 2005 and cannot even install. We probabaly can test it and if it's good we can port only what's necessary to our code.

mohawk2 commented 2 years ago

https://metacpan.org/pod/PDL::Transform::Color#t_cielab-or-t_lab converts RGB <-> Lab space.

iynehz commented 1 year ago

pending https://github.com/PDLPorters/PDL-Transform-Color/issues/6

mohawk2 commented 1 year ago

P:T:Color has been fairly thoroughly updated, and now uses in many places PDL::Graphics::ColorSpace, which is itself a PDL port of Graphics::ColorObject.

iynehz commented 1 year ago

Using PDL::Graphics::ColorSpace and released as 0.002002