-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ability to create a new color palette #152
Comments
This is not a bad idea so I'm going to entertain it. However it might be a challenge as the package right now, relies on a lot of precomputed objects such as |
If anyone is going to tackle this, I'd love the solution to work based on a single color as well. Often I find myself having fixed colors for specific categories and needing to distinguish several sub-classes within those. So if I could generate let's say two palettes with three colors each, one with three different reds based on my red of reference and the other one with three different blues, based on my blue of reference, by slightly varying the based colors in HCL space, that would be extremely useful for me. |
@mschilli87 have you seen https://uicolors.app/create it could be helpful! I use it with tailwind css for palette generation i can imagine you can explore this in R |
@JosiahParry: Thx. I'll have a look. I also found https://mdigi.tools/color-shades which basically does what I want. But I'd like to have a way to get those in R directly because at the number of colors I need depends on the input data, so I'm kinda looking for base_color <- "#aa55ff"
# ...lot's of code...
n_categories <- # ...some code determining the required number of colors
# ...more code...
colors <- magic_funtion(base_color, n_categories) resulting in |
@mschilli87 if I don't get you wrong you're looking for something like this
however, I am not sure, if {paletteer} is the right place for implementation. the monochromeR package aimed at something similar, but is currently in need of revision (I suggested options to do so and @cararthompson is currently thinking about it). what do you think about this @EmilHvitfeldt, @mschilli87, @cararthompson? |
Thanks for the mention @xx02al ! Just to clarify, {monochromeR} does currently work, and is available on CRAN - the improvements are to do with streamlining the code and function philosophies. You can read my write-up with a demo here. I've also turned it into a shiny app which has a few extra functionalities. https://www.cararthompson.com/shinyapps/2022-01-11-monochromer/monochromer Hope this helps! |
@xx02al: This is exactly the kind of function I was looking for. Thank you! |
I'd like to be able to provide say 5 colors as hex codes as a new palette. Then I'd be able to use that new hypothetical palette with
palette_dynamic()
to get the color interpolation. E.gThe text was updated successfully, but these errors were encountered: