Skip to content
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

Resolver lugar de los grises en paleta de colores #14

Open
pablotis opened this issue May 23, 2022 · 2 comments
Open

Resolver lugar de los grises en paleta de colores #14

pablotis opened this issue May 23, 2022 · 2 comments
Assignees

Comments

@pablotis
Copy link
Collaborator

pablotis commented May 23, 2022

Opción 1: Pasar grises al centro de la paleta:


  paletas <- list(

    `c2_continuo`  = c("#50B8B1", "#9283BE"),
    `c2_contraste` = c("#50B8B1", "#EE3D8F"),
    `c10_todos`     = c("#EE3D8F", "#F7941E", "#FFD100", "#D7DF23", "#AAAAAA", "#E7E7E7", "#50B8B1",
                        "#9283BE", "#37BBED", "#50535C"))

  #rlang::check_installed("grDevices", reason = "Para usar `dnmye_paletas()`")

  pal <- paletas[[palette]]

  if (reverse) pal <- rev(pal)

  grDevices::colorRampPalette(pal, ...)
}

Opción 2: sacar grises de la paleta C10_todos:


  paletas <- list(

    `c2_continuo`  = c("#50B8B1", "#9283BE"),
    `c2_contraste` = c("#50B8B1", "#EE3D8F"),
    `c8_todos`     = c("#EE3D8F", "#F7941E", "#FFD100", "#D7DF23", "#50B8B1",
                        "#9283BE", "#37BBED", "#50535C"))

  #rlang::check_installed("grDevices", reason = "Para usar `dnmye_paletas()`")

  pal <- paletas[[palette]]

  if (reverse) pal <- rev(pal)

  grDevices::colorRampPalette(pal, ...)
}

Opción 3: Armar dos paletas, una con grises otra sin grises


  paletas <- list(

    `c2_continuo`  = c("#50B8B1", "#9283BE"),
    `c2_contraste` = c("#50B8B1", "#EE3D8F"),
    `c8`     = c("#EE3D8F", "#F7941E", "#FFD100", "#D7DF23", "#50B8B1",
                        "#9283BE", "#37BBED", "#50535C"),
    `c10_todos`     = c("#EE3D8F", "#F7941E", "#FFD100", "#D7DF23", "#AAAAAA", "#E7E7E7", "#50B8B1",
                        "#9283BE", "#37BBED", "#50535C"))

  #rlang::check_installed("grDevices", reason = "Para usar `dnmye_paletas()`")

  pal <- paletas[[palette]]

  if (reverse) pal <- rev(pal)

  grDevices::colorRampPalette(pal, ...)
}
@pablotis pablotis self-assigned this May 23, 2022
@SSoubie
Copy link
Contributor

SSoubie commented Aug 9, 2022

Mi productividad aumentó un 200% con estas opciones

@pablotis
Copy link
Collaborator Author

Bien! Cuál te pareció mejor?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants