Skip to content

Preserve names when creating a color palette #12

Description

@wjakethompson

Currently all colors are converted and displayed as hexadecimal values:

library(taylor)

color_palette(c("firebrick", "wheat", "#0051ba"))
#> <color_palette[3]>
#>     #B22222 
#>     #F5DEB3 
#>     #0051ba

Created on 2021-10-18 by the reprex package (v2.0.0)

Would be nice if names were preserved, e.g.,

color_palette(c("firebrick", "wheat", "#0051ba"))
#> <color_palette[3]>
#>     firebrick
#>     wheat
#>     #0051ba

Similarly, could be good to preserve named vectors as well. For example,

ku_colors <- c(ku_blue = "#0051ba", crimson = "#e8000d", jayhawk_yellow = "#ffc82d")

color_palette(c("firebrick", "wheat", "#0051ba"))
#> <color_palette[3]>
#>     ku_blue
#>     crimson
#>     jayhawk_yellow

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions