clauswilke / colorblindr

An R package to simulate colorblindness on R figures.
MIT License
306 stars 29 forks source link

added color palette selector (customize palette) #3

Closed wckdouglas closed 6 years ago

wckdouglas commented 6 years ago

I implemented new buttons to pick color and add to a color list, undo the pick and clear the color list. The color list will be shown as palette_plot on a new tab and a R code line will be generated for simple copy-and-paste purpose.

example

codecov-io commented 6 years ago

Codecov Report

Merging #3 into master will decrease coverage by 1.57%. The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master       #3      +/-   ##
==========================================
- Coverage   18.03%   16.45%   -1.58%     
==========================================
  Files           9        9              
  Lines         438      480      +42     
==========================================
  Hits           79       79              
- Misses        359      401      +42
Impacted Files Coverage Δ
R/HCL_color_picker.R 0% <0%> (ø) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 9a7e5de...6bd7d01. Read the comment docs.

clauswilke commented 6 years ago

One more thing, more an idea than a requirement for merging at this time: It would be great if one could click on the colors in the palette plot to set that color in the color picker. With that, though, the unpick function would have to remove the currently selected color, not the last color that was picked.

wckdouglas commented 6 years ago

So turns out it is not too hard to implement targeted-color-removal. A minor problem now is that it is silently ignoring duplicated color selections. Ideally, a error/warning message seems to make more sense.

clauswilke commented 6 years ago

I made some additional improvements, including making the palette colors clickable. It's quite nice now I think.

wckdouglas commented 6 years ago

This does look much better!

Found a bug on allowing empty color selection, and is fixed in my new pull request empty_color_bug