{"id":32203671,"url":"https://github.com/nelsonquesado/okcolors","last_synced_at":"2026-02-19T08:35:35.626Z","repository":{"id":292472048,"uuid":"981014486","full_name":"nelsonquesado/okcolors","owner":"nelsonquesado","description":"Color palettes inspired by OkGo music videos for R.","archived":false,"fork":false,"pushed_at":"2025-05-18T14:19:03.000Z","size":6140,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-09T03:42:09.811Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nelsonquesado.png","metadata":{"files":{"readme":"README.md","changelog":"NEWS.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-05-10T06:29:41.000Z","updated_at":"2025-05-18T14:19:06.000Z","dependencies_parsed_at":null,"dependency_job_id":"c48984a6-acab-4cb7-826f-964523555182","html_url":"https://github.com/nelsonquesado/okcolors","commit_stats":null,"previous_names":["nelsonquesado/okcolors"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/nelsonquesado/okcolors","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nelsonquesado%2Fokcolors","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nelsonquesado%2Fokcolors/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nelsonquesado%2Fokcolors/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nelsonquesado%2Fokcolors/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nelsonquesado","download_url":"https://codeload.github.com/nelsonquesado/okcolors/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nelsonquesado%2Fokcolors/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29608581,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-19T06:47:36.664Z","status":"ssl_error","status_checked_at":"2026-02-19T06:45:47.551Z","response_time":117,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-10-22T04:45:03.176Z","updated_at":"2026-02-19T08:35:35.614Z","avatar_url":"https://github.com/nelsonquesado.png","language":"R","funding_links":[],"categories":["Themes and aesthetics"],"sub_categories":[],"readme":"# okcolors \u003cimg src=\"figs/okcolors.logo.png?raw=true\" alt=\"logo\" align=\"right\" height=\"180\"/\u003e\n\n###### v0.1.0 {CRAN} release 2025-05-15\n\n###### v0.1.1 {DEV}\n\n[![Lifecycle: experimental](https://lifecycle.r-lib.org/articles/figures/lifecycle-experimental.svg)](https://lifecycle.r-lib.org/articles/stages.html)\n\n[![CRAN/METACRAN Total downloads](https://cranlogs.r-pkg.org/badges/grand-total/okcolors?color=blue)](https://CRAN.R-project.org/package=okcolors) \u003cbr/\u003e\n\n`okcolors` is a collection of aesthetically appealing color palettes inspired by OK Go music videos for data visualization with 'ggplot2'. All palettes support both discrete and continuous data.\n\n## Installation\n\n``` r\ninstall.packages(\"okcolors\")\nlibrary(okcolors)\n\n# dev version:\ninstall.packages('remotes') # if not already installed\n# wait for the installation to complete\n\nremotes::install_github('nelsonquesado/okcolors@main')\nlibrary(okcolors)\n```\n\n## Usage\n\nThe `okcolors` package provides **three** simple functions:\n\n1.  `okcolors()` – returns a `n` number of color hex codes from a named `palette`.\n2.  `scale_color_okcolors()` – adds a custom color scale to a `ggplot2` plot.\n3.  `scale_fill_okcolors()` – adds a custom fill scale to a `ggplot2` plot.\n4.  `valid_palettes()` - lists available palettes in the okcolors Package.\n\n``` r\nlibrary(ggplot2)\nlibrary(okcolors)\n\nggplot(mpg, aes(displ, hwy, color = class)) +\n  geom_point(size = 3) +\n  scale_color_okcolors()  # Just add it like any ggplot scale\n```\n\n\u003cimg src=\"figs/example1.ok.png?raw=true\" height=\"450\"/\u003e\n\n``` r\nlibrary(ggplot2)\nlibrary(okcolors)\n\nggplot(mpg, aes(class, fill = class)) +\n  geom_bar() +\n  scale_fill_okcolors(\"skyscrapers\")  # Again, just add it like any ggplot scale\n```\n\n\u003cimg src=\"figs/example2.ok.png?raw=true\" height=\"450\"/\u003e\n\nThere are 5 different collor palettes, which are descibed in the next section.\n\n``` r\nvalid_palettes()\n\n[1] \"it\" \"stone\" \"skyscrapers\" \"obsession\" \"moment\" \n\n```\n\nAlthough the palettes are made of 5 basic colors, the package interpolates any number of colors to match the palette.\n\n```r\nokcolors('obsession', 12)\n [1] \"#45924C\" \"#83A744\" \"#C1BC3C\" \"#EFC344\" \"#ECA07C\" \"#EA7DB5\"\n [7] \"#EB66B9\" \"#EF5C87\" \"#F35155\" \"#C4536D\" \"#845A9E\" \"#4561CF\"\n```\n\n## Palettes\n\n### it - Here it goes again\n\n\u003cimg src=\"figs/it.jpeg?raw=true\" height=\"250\"/\u003e\n\n\u003cimg src=\"figs/pal.it.jpeg?raw=true\" height=\"250\"/\u003e\n\n```r\nlibrary(tidyverse); library(okcolors); library(aopdata); library(sf)\n\nread_landuse('fortaleza', geometry = T) %\u003e% \n  group_by(id_hex, geometry) %\u003e% \n  reframe(`Low-income individuals` = P001 * (R003 \u003c= 4) %\u003e% if_else(is.na(.), 0, .),\n          `Low-complexity job psitions` = T002) %\u003e% \n  pivot_longer(cols = 3:4) %\u003e% \n  mutate(value = value/sum(value)) %\u003e% \n  st_as_sf() %\u003e% \n  ggplot() +\n  geom_sf(aes(fill = value), color = NA) +\n  facet_grid(.~name) + \n  scale_fill_okcolors('it',\n                      discrete = F,\n                      transform = 'log',\n                      na.value = okcolors('it', n = 1, direction = 1),\n                      breaks = c(.000001, .0001, .005),\n                      labels = c('0.0001%', '0.01%', '0.5%'),\n                      name = 'Proportion\\n',\n                      direction = 1) +\n  theme_linedraw() +\n  labs(title = 'Spatial misatch between low-complexity job positions\\nand low-income individuals in Fortaleza, Brazil.') +\n  theme(legend.position = 'bottom')\n```\n\u003cimg src=\"figs/example.it.png?raw=true\" height=\"320\"/\u003e\n\nSource: Pereira, Rafael H. M. et al. (2022) _Distribuição espacial de características sociodemográficas e localização de empregos e serviços públicos das vinte maiores cidades do Brasil._ Texto para Discussão 2772. Ipea - Instituto de Pesquisa Econômica Aplicada. http://dx.doi.org/10.38116/td2772\n\n### stone - A stone only rolls downhill\n\n\u003cimg src=\"figs/stone.jpeg?raw=true\" height=\"250\"/\u003e\n\n\u003cimg src=\"figs/pal.stone.jpeg?raw=true\" height=\"250\"/\u003e\n\n```r\nlibrary(tidyverse); library(okcolors)\nlibrary(GTFSwizard); library(hrbrthemes)\n\nfor_bus_gtfs %\u003e% \n  get_fleet('by.hour') %\u003e% \n  ggplot +\n  geom_line(aes(x = hour, y = fleet, color = service_pattern, group = service_pattern), linewidth = 2) +\n  scale_color_okcolors('stone',\n                       discrete = T,\n                       direction = -1,\n                       name = 'Service Pattern',\n                       labels = c('Business days', 'Sundays', 'Saturdays')) +\n  theme_linedraw() +\n  scale_y_comma(big.mark = '.') +\n  labs(title = 'Bus fleet variation during the day in Fortaleza, Brazil.',\n       x = 'Time of the day', y = 'Fleet (veh)') +\n  theme(legend.position = 'bottom')\n```\n\n\u003cimg src=\"figs/example.stone.png?raw=true\" height=\"320\"/\u003e\n\nSource: Quesado Filho, N. de O., Guimarães, C. G. C. (2024). _GTFSwizard: Exploring and Manipulating 'GTFS' Files_. R package version 1.1.0, \u003chttps://github.com/OPATP/GTFSwizard\u003e.\n\n### skyscrapers - Skyscrapers\n\n\u003cimg src=\"figs/skyscrapers.jpeg?raw=true\" height=\"250\"/\u003e\n\n\u003cimg src=\"figs/pal.skyscrapers.jpeg?raw=true\" height=\"250\"/\u003e\n\n```r\nlibrary(tidyverse); library(okcolors); library(aopdata); library(hrbrthemes)\n\nread_population('all') %\u003e% \n  mutate(`Proportion of white individuals` = (P002/P001) %\u003e% round(1)) %\u003e% \n  group_by(`Proportion of white individuals`, name_muni) %\u003e% \n  reframe(`Average per capita household income` = mean(R001, na.rm = T)) %\u003e% \n  ggplot +\n  geom_line(aes(`Proportion of white individuals`,\n                `Average per capita household income`,\n                color = `Average per capita household income`)) +\n  geom_point(aes(`Proportion of white individuals`,\n                 `Average per capita household income`,\n                 color = `Average per capita household income`),\n             size = 4) +\n  facet_wrap(name_muni~.) +\n  scale_color_okcolors('skyscrapers', guide = 'none', discrete = F) +\n  scale_x_percent(breaks = c(0, 0.2, .4, .6, .8)) +\n  scale_y_comma(big.mark = '.', prefix = 'R$ ', breaks = c(1000, 3000, 5000)) +\n  labs(title = 'Average income for different racial contexts') +\n  theme_linedraw()\n```\n\n\u003cimg src=\"figs/example.skyscrapers.png?raw=true\" height=\"400\"/\u003e\n\nSource: Pereira, Rafael H. M. et al. (2022) _Distribuição espacial de características sociodemográficas e localização de empregos e serviços públicos das vinte maiores cidades do Brasil._ Texto para Discussão 2772. Ipea - Instituto de Pesquisa Econômica Aplicada. http://dx.doi.org/10.38116/td2772\n\n### obsession - Obsession\n\n\u003cimg src=\"figs/obsession.jpeg?raw=true\" height=\"250\"/\u003e\n\n\u003cimg src=\"figs/pal.obsession.jpeg?raw=true\" height=\"250\"/\u003e\n\n``` r\nlibrary(tidyverse); library(okcolors)\n\nmpg %\u003e% \n  ggplot() +\n  geom_boxplot(aes(x = class, y = hwy, fill = class)) +\n  labs(title = \"Highway MPG by Car Class\",\n       x = \"Car Class\",\n       y = \"Highway MPG\") +\n  theme_linedraw() +\n  theme(legend.position = \"none\") +\n  scale_fill_okcolors()\n```\n\n\u003cimg src=\"figs/example.obsession.png?raw=true\" height=\"320\"/\u003e\n\nWickham H, Averick M, Bryan J, Chang W, McGowan LD, François R, Grolemund G, Hayes A, Henry L, Hester J, Kuhn M, Pedersen TL, Miller E, Bache SM, Müller K, Ooms J, Robinson D, Seidel DP, Spinu V, Takahashi K, Vaughan D, Wilke C, Woo K, Yutani H (2019). “Welcome to the tidyverse.” _Journal of Open Source Software_, *4*(43), 1686. doi:10.21105/joss.01686 \u003chttps://doi.org/10.21105/joss.01686\u003e.\n\n### moment - The one moment\n\n\u003cimg src=\"figs/moment.jpeg?raw=true\" height=\"250\"/\u003e\n\n\u003cimg src=\"figs/pal.moment.jpeg?raw=true\" height=\"250\"/\u003e\n\n```r\nlibrary(okcolors); library(tidyverse)\n\ndiamonds %\u003e% \n  ggplot(aes(x = cut, fill = clarity)) +\n  geom_bar(position = \"fill\") +\n  labs(title = \"Proportion of Clarity Within Diamond Cuts\",\n       x = \"Cut\",\n       y = \"Proportion\",\n       fill = \"Clarity\") +\n  theme_linedraw() +\n  scale_fill_okcolors('moment', direction = -1)\n```\n\n\u003cimg src=\"figs/example.moment.png?raw=true\" height=\"400\"/\u003e\n\nH. Wickham. ggplot2: Elegant Graphics for Data Analysis. Springer-Verlag New York, 2016.\n\n## Contributing\n\nContributions are welcome! To report a bug, suggest a feature, or contribute code, please use the repository’s [Issues](https://github.com/nelsonquesado/okcolors/issues).\n\n## Related Packages\n\n`okcolors` mainly relies on [ggplot2](https://ggplot2.tidyverse.org/).\n\n## Citation\n\nTo cite package ‘okcolors’ in publications use:\n\n-   Quesado Filho, N. O. de, \u0026 Silveira, A. F. T. (2025). *okcolors: A Set of Color Palettes Inspired by OK Go Music Videos for 'ggplot2' in R.* R package version 0.1.0. [DOI: 10.32614/CRAN.package.okcolors](https://cran.r-project.org/package=okcolors).\n\nA BibTeX entry for LaTeX users is\n\n``` tex\n  @Manual{quesado.silveira.2025,\n    title = {okcolors: A Set of Color Palettes Inspired by OK Go Music Videos for ggplot2 in R.},\n    author = {Nelson de O. {Quesado Filho} and Ana Flávia T. {Silveira},\n    year = {2025},\n    note = {R package version 0.1.0},\n    url = {https://cran.r-project.org/package=okcolors},\n    doi = {10.32614/CRAN.package.okcolors}}\n```\n\n## Acknowledgement\n\n**okcolors** is developed by [Nelson Quesado](https://github.com/nelsonquesado/) and [Ana Flávia Teles](https://www.behance.net/anvie).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnelsonquesado%2Fokcolors","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnelsonquesado%2Fokcolors","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnelsonquesado%2Fokcolors/lists"}