{"id":16273270,"url":"https://github.com/mccarthy-m-g/palettes","last_synced_at":"2025-03-16T13:31:16.207Z","repository":{"id":61408782,"uuid":"422732562","full_name":"mccarthy-m-g/palettes","owner":"mccarthy-m-g","description":"Methods for working with colour palettes in R","archived":false,"fork":false,"pushed_at":"2024-09-19T21:21:38.000Z","size":13848,"stargazers_count":25,"open_issues_count":14,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-27T09:41:32.884Z","etag":null,"topics":["color-palette","colors","colour-palette","colours","ggplot2","gt","palettes","r","r-package","rstats","vctrs"],"latest_commit_sha":null,"homepage":"https://mccarthy-m-g.github.io/palettes/","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mccarthy-m-g.png","metadata":{"files":{"readme":"README.Rmd","changelog":"NEWS.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-10-29T22:57:05.000Z","updated_at":"2025-01-18T16:30:59.000Z","dependencies_parsed_at":"2024-01-26T23:26:59.751Z","dependency_job_id":"b17330ad-6c79-4b7f-8682-9b2f38218a22","html_url":"https://github.com/mccarthy-m-g/palettes","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mccarthy-m-g%2Fpalettes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mccarthy-m-g%2Fpalettes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mccarthy-m-g%2Fpalettes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mccarthy-m-g%2Fpalettes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mccarthy-m-g","download_url":"https://codeload.github.com/mccarthy-m-g/palettes/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243816924,"owners_count":20352455,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["color-palette","colors","colour-palette","colours","ggplot2","gt","palettes","r","r-package","rstats","vctrs"],"created_at":"2024-10-10T18:23:31.738Z","updated_at":"2025-03-16T13:31:15.794Z","avatar_url":"https://github.com/mccarthy-m-g.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"---\noutput: github_document\nalways_allow_html: true\n---\n\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n```{r, include = FALSE, cache = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  fig.path = \"man/figures/README-\",\n  out.width = \"100%\",\n  cache = FALSE,\n  asciicast_theme = \"pkgdown\"\n)\nasciicast::init_knitr_engine(\n  startup = quote({\n    library(tibble)\n    library(palettes)\n    set.seed(1) }),\n  echo = TRUE,\n  echo_input = FALSE\n)\n```\n\n# palettes \u003ca href='https://mccarthy-m-g.github.io/palettes/'\u003e\u003cimg src='man/figures/logo.png' align=\"right\" height=\"139\"/\u003e\u003c/a\u003e\n\n\u003c!-- badges: start --\u003e\n[![R-CMD-check](https://github.com/mccarthy-m-g/palettes/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/mccarthy-m-g/palettes/actions/workflows/R-CMD-check.yaml)\n[![Codecov test coverage](https://codecov.io/gh/mccarthy-m-g/palettes/branch/main/graph/badge.svg)](https://app.codecov.io/gh/mccarthy-m-g/palettes?branch=main)\n[![CRAN status](https://www.r-pkg.org/badges/version/palettes)](https://CRAN.R-project.org/package=palettes)\n[![R-universe status](https://mccarthy-m-g.r-universe.dev/badges/palettes)](https://mccarthy-m-g.r-universe.dev/palettes)\n[![CRAN downloads](https://cranlogs.r-pkg.org/badges/grand-total/palettes)](https://cran.r-project.org/package=palettes)\n\u003c!-- badges: end --\u003e\n\npalettes is an R package for working with colour vectors and colour palettes. There are three main goals to the palettes package, each described in a vignette:\n\n- To provide a new family of colour classes (`palettes_colour` and `palettes_palette`) that always print as hex codes with colour previews; `vignette(\"palettes\")`.\n\n- To provide a comprehensive library of methods for working with colour vectors and colour palettes, including methods for ggplot2, `vignette(\"ggplot2\")`; gt, `vignette(\"gt\")`; biscale, `vignette(\"biscale\")`; and other colour packages, `vignette(\"compatibility\")`.\n\n- To make it easy for anyone to make their own colour palette package; `vignette(\"creating-packages\")`. Colour palette packages made with palettes exist solely for the purpose of distributing colour palettes and get access to all the features of palettes for free.\n\n## Installation\n\nInstall palettes from [CRAN](https://CRAN.R-project.org/package=palettes) with:\n\n```r\ninstall.packages(\"palettes\")\n```\n\nInstall the development version from [GitHub](https://github.com/mccarthy-m-g/palettes) or [R-universe](https://mccarthy-m-g.r-universe.dev/palettes) with:\n\n```r\n# Install from GitHub\n# install.packages(\"remotes\")\nremotes::install_github(\"mccarthy-m-g/palettes\")\n\n# Install from R-universe\ninstall.packages(\"palettes\", repos = \"https://mccarthy-m-g.r-universe.dev\")\n```\n\nInstall the [WebAssembly](https://webassembly.org) version for use in [WebR](https://docs.r-wasm.org/webr/latest/) applications with:\n\n```r\n# Install CRAN version from r-wasm\ninstall.packages(\"palettes\", repos = \"https://repo.r-wasm.org\")\n\n# Install development version from R-universe\ninstall.packages(\n  \"palettes\",\n  repos = c(\"https://mccarthy-m-g.r-universe.dev\", \"https://repo.r-wasm.org\")\n)\n```\n\n## Usage\n\n```{r}\nlibrary(palettes)\n```\n\nColours can be specified by name (as listed by `grDevices::colours()`):\n\n```{asciicast pal-colour-character}\npal_colour(\"red\")\n```\n\nOr by hex code:\n\n```{asciicast pal-colour-hex}\npal_colour(\"#FF0000\")\n```\n\nMultiple colours can be specified at once as a character vector:\n\n```{asciicast pal-colour-vector}\npal_colour(c(\"#a00e00\", \"#d04e00\", \"#f6c200\", \"#0086a8\", \"#132b69\"))\n```\n\nNamed colour palettes can be specified in the same way:\n\n```{asciicast pal-palette}\npal_palette(\n  egypt = c(\"#dd5129\", \"#0f7ba2\", \"#43b284\", \"#fab255\"),\n  java  = c(\"#663171\", \"#cf3a36\", \"#ea7428\", \"#e2998a\", \"#0c7156\")\n)\n```\n\nColours also print nicely in tibbles:\n\n```{asciicast tibble}\nas_tibble(pal_colour(c(\"#dd5129\", \"#0f7ba2\", \"#43b284\", \"#fab255\")))\n```\n\n## Documentation\n\nSee at [`https://mccarthy-m-g.github.io/palettes/`](https://mccarthy-m-g.github.io/palettes/reference/index.html) and also in the installed package: `help(package = \"palettes\")`.\n\n## License\n\nMIT © Michael McCarthy\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmccarthy-m-g%2Fpalettes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmccarthy-m-g%2Fpalettes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmccarthy-m-g%2Fpalettes/lists"}