You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was thinking it would be kind of neat to have an option in which colors were assigned from the middle of a palette, rather than from the left (i.e., direction = 1) or right (i.e., direction = -1).
For example say we wanted to use the following palette, but we only had three colors:
That's not terrible, but it can be inconvenient if dealing with a lot of changing group conditions.
What about an even number of groups? Could include an argument for starting from the left or the right of the middle color. Maybe even one for dropping the middle color. This could include similar logic for an even number of colors and an odd number of groups.
Thus, I could see a modification of the paletteer_* functions to include some new arguments:
paletteer_d(..., centered = c(TRUE, FALSE), side = c("left", "right", "middle"))
#Examples of functionality:
paletteer_d(ggthemes, hc_bg, n = 3, centered = TRUE) #original color index: [2, 3, 4]
[1] "#c3d6df" "#ed111a" "#ebebeb"
paletteer_d(ggthemes, hc_bg, n = 4, centered = TRUE, side = "left") #original color index: [1, 2, 3, 4]
[1] "#d5e4eb" "#c3d6df" "#ed111a" "#ebebeb"
paletteer_d(ggthemes, hc_bg, n = 4, centered = TRUE, side = "right") #original color index: [2, 3, 4, 5]
[1] "#c3d6df" "#ed111a" "#ebebeb" "#c9c9c9"
paletteer_d(ggthemes, hc_bg, n = 4, centered = TRUE, side = "middle") #original color index: [1, 2, 4, 5]
[1] "#d5e4eb" "#c3d6df" "#ebebeb" "#c9c9c9"
Thoughts?
The text was updated successfully, but these errors were encountered:
I was thinking it would be kind of neat to have an option in which colors were assigned from the middle of a palette, rather than from the left (i.e., direction = 1) or right (i.e., direction = -1).
For example say we wanted to use the following palette, but we only had three colors:
Normally we'd do something like:
But what if we wanted to use the middle three colors? Usually I'd do something like:
That's not terrible, but it can be inconvenient if dealing with a lot of changing group conditions.
What about an even number of groups? Could include an argument for starting from the left or the right of the middle color. Maybe even one for dropping the middle color. This could include similar logic for an even number of colors and an odd number of groups.
Thus, I could see a modification of the
paletteer_*
functions to include some new arguments:Thoughts?
The text was updated successfully, but these errors were encountered: