trekcolors

Strak Trek color palettes

https://github.com/leonawicz/trekcolors

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (17.4%) to scientific vocabulary

Keywords

color-palettes lcars r-package star-trek
Last synced: 10 months ago · JSON representation

Repository

Strak Trek color palettes

Basic Info
Statistics
  • Stars: 30
  • Watchers: 6
  • Forks: 5
  • Open Issues: 0
  • Releases: 4
Topics
color-palettes lcars r-package star-trek
Created almost 7 years ago · Last pushed over 1 year ago
Metadata Files
Readme Changelog License Code of conduct Codemeta

README.Rmd

---
output: github_document
---



```{r, include = FALSE}
knitr::opts_chunk$set(
  collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", 
  fig.height = 3, out.width = "100%", dpi = 150, message = FALSE, 
  warning = FALSE, error = FALSE, dev.args = list(type = "cairo")
)
```

# trekcolors 


[![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/)
[![R-CMD-check](https://github.com/leonawicz/trekcolors/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/leonawicz/trekcolors/actions/workflows/R-CMD-check.yaml)
[![Codecov test coverage](https://codecov.io/gh/leonawicz/trekcolors/graph/badge.svg)](https://app.codecov.io/gh/leonawicz/trekcolors)
[![CRAN status](https://www.r-pkg.org/badges/version/trekcolors)](https://CRAN.R-project.org/package=trekcolors)
[![CRAN downloads](https://cranlogs.r-pkg.org/badges/grand-total/trekcolors)](https://cran.r-project.org/package=trekcolors) 
[![Github Stars](https://img.shields.io/github/stars/leonawicz/trekcolors.svg?style=social&label=Github)](https://github.com/leonawicz/trekcolors)


The `trekcolors` package provides a collection of color palettes based on Star Trek. It also offers functions for custom palettes and `scale_*` functions for use with `ggplot2`.

## Installation

Install the CRAN release of `trekcolors` with

```r
install.packages("trekcolors")
```

Install the development version from GitHub with

```r
# install.packages("remotes")
remotes::install_github("leonawicz/trekcolors")
```

## Examples

### Basics

```{r ex1}
library(trekcolors)
library(ggplot2)

trek_pal("starfleet")

trek_pal("lcars_2357")
lcars_pal("2357") # there are some special functions for LCARS colors
```

Preview the `starfleet` and `lcars_2357` palettes.

```{r ex2}
view_trek_pals(c("starfleet", "lcars_2357"))
```

### Scale functions for use with ggplot2

```{r ex3}
p <- ggplot(iris, aes(Sepal.Width, Sepal.Length, color = Species)) + 
  geom_point(size = 5, alpha = 0.75)
p + scale_color_trek() # starfleet is default palette

p <- ggplot(diamonds, aes(carat, price, color = clarity)) + 
  geom_point()
p + scale_color_lcars("2357") # equivalent to scale_color_trek("lcars_2357")

p <- ggplot(diamonds, aes(carat, stat(count), fill = cut)) +
  geom_density(position = "fill")
p + scale_fill_trek("klingon")
p + scale_fill_trek("romulan")
p + scale_fill_trek("andorian")

p <- ggplot(diamonds, aes(carat, stat(count), fill = cut)) +
  geom_density(position = "fill")
p + scale_fill_lcars("2357")
p + scale_fill_lcars1("atomic-tangerine", dark = TRUE)
p + scale_fill_lcars2("pale-canary", "danub")

d <- diamonds[diamonds$cut >= "Very Good", ]
p <- ggplot(d, aes(carat, stat(count), fill = cut)) +
  geom_density(position = "fill")
p + scale_fill_trek("starfleet")
```

### Palettes with named colors

The four LCARS palettes that have a year in their series name are special in that these official standard LCARS colors have formal names.

```{r ex4}
# lcars_pals() # print list of all LCARS palettes

lcars_colors() # full set of unique names across the four palettes

lcars_2357() # specific color series; also 2369, 2375, 2379

lcars_2357("lilac", "mariner") # select by name
```

### Custom palettes

In addition to these and all the other predefined palettes, custom palettes can be constructed using official LCARS color names. This is like `colorRampPalette()` but with the ability to recognize official LCARS color names. This functionality was leveraged by `scale_color_lcars1()` and `scale_color_lcars2()` seen above when making sequential or divergent palettes based on specific LCARS colors for use with ggplot.

```{r ex5}
lcars_custom_pal <- lcars_colors_pal(c("pale-canary", "eggplant"))
lcars_custom_pal(8)

p <- ggplot(diamonds, aes(carat, stat(count), fill = cut)) +
  geom_density(position = "fill")
p + scale_fill_lcars2("pale-canary", "danub")

# p + scale_fill_manual(values = lcars_custom_pal(8)) # equivalent

p + scale_fill_lcars2("pale-canary", "danub", divergent = TRUE)
p + scale_fill_lcars2("pale-canary", "danub", dark = TRUE, divergent = TRUE)
```

### All predefined palettes

```{r ex6, fig.width=6, fig.height=8}
# See available palette names
trek_pal()

# view all predefined palettes
view_trek_pals()
```

## Packages in the trekverse

rtrek: The core Star Trek package

Datasets related to Star Trek, API wrappers to external data sources, and more.

lcars: LCARS aesthetic for Shiny

Create Shiny apps based on the Library Computer Access/Retrieval System (LCARS).

trekcolors: A color palette package

Predefined and customizable Star Trek themed color palettes and related functions.

trekfont: A fonts package

True (Trek) type fonts to style your Star Trek themed graphics text.

## Citation Matthew Leonawicz (`r substr(Sys.Date(), 1, 4)`). trekcolors: Star Trek Color Palettes. R package version 0.2.0. https://CRAN.R-project.org/package=trekcolors ## Contribute Contributions are welcome. Contribute through GitHub via pull request. Please create an issue first if it is regarding any substantive feature add or change. --- Please note that the `trekcolors` project is released with a [Contributor Code of Conduct](https://github.com/leonawicz/trekcolors/blob/master/CODE_OF_CONDUCT.md). By contributing to this project, you agree to abide by its terms.

Owner

  • Name: Matt Leonawicz
  • Login: leonawicz
  • Kind: user
  • Location: Denver, Colorado, USA

R and Shiny developer | Software developer @ropensci @r-music

CodeMeta (codemeta.json)

{
  "@context": "https://doi.org/10.5063/schema/codemeta-2.0",
  "@type": "SoftwareSourceCode",
  "identifier": "trekcolors",
  "description": "Provides a dataset of predefined color palettes based on the Star Trek science fiction series, associated color palette functions, and additional functions for generating customized palettes that are on theme. The package also offers functions for applying the palettes to plots made using the 'ggplot2' package.",
  "name": "trekcolors: Star Trek Color Palettes",
  "codeRepository": "https://github.com/leonawicz/trekcolors",
  "issueTracker": "https://github.com/leonawicz/trekcolors/issues",
  "license": "https://spdx.org/licenses/MIT",
  "version": "0.2.0",
  "programmingLanguage": {
    "@type": "ComputerLanguage",
    "name": "R",
    "url": "https://r-project.org"
  },
  "runtimePlatform": "R version 4.4.1 (2024-06-14 ucrt)",
  "provider": {
    "@id": "https://cran.r-project.org",
    "@type": "Organization",
    "name": "Comprehensive R Archive Network (CRAN)",
    "url": "https://cran.r-project.org"
  },
  "author": [
    {
      "@type": "Person",
      "givenName": "Matthew",
      "familyName": "Leonawicz",
      "email": "rpkgs@pm.me",
      "@id": "https://orcid.org/0000-0001-9452-2771"
    }
  ],
  "maintainer": [
    {
      "@type": "Person",
      "givenName": "Matthew",
      "familyName": "Leonawicz",
      "email": "rpkgs@pm.me",
      "@id": "https://orcid.org/0000-0001-9452-2771"
    }
  ],
  "softwareSuggestions": [
    {
      "@type": "SoftwareApplication",
      "identifier": "testthat",
      "name": "testthat",
      "provider": {
        "@id": "https://cran.r-project.org",
        "@type": "Organization",
        "name": "Comprehensive R Archive Network (CRAN)",
        "url": "https://cran.r-project.org"
      },
      "sameAs": "https://CRAN.R-project.org/package=testthat"
    },
    {
      "@type": "SoftwareApplication",
      "identifier": "knitr",
      "name": "knitr",
      "provider": {
        "@id": "https://cran.r-project.org",
        "@type": "Organization",
        "name": "Comprehensive R Archive Network (CRAN)",
        "url": "https://cran.r-project.org"
      },
      "sameAs": "https://CRAN.R-project.org/package=knitr"
    },
    {
      "@type": "SoftwareApplication",
      "identifier": "rmarkdown",
      "name": "rmarkdown",
      "provider": {
        "@id": "https://cran.r-project.org",
        "@type": "Organization",
        "name": "Comprehensive R Archive Network (CRAN)",
        "url": "https://cran.r-project.org"
      },
      "sameAs": "https://CRAN.R-project.org/package=rmarkdown"
    },
    {
      "@type": "SoftwareApplication",
      "identifier": "covr",
      "name": "covr",
      "provider": {
        "@id": "https://cran.r-project.org",
        "@type": "Organization",
        "name": "Comprehensive R Archive Network (CRAN)",
        "url": "https://cran.r-project.org"
      },
      "sameAs": "https://CRAN.R-project.org/package=covr"
    }
  ],
  "softwareRequirements": {
    "1": {
      "@type": "SoftwareApplication",
      "identifier": "R",
      "name": "R",
      "version": ">= 2.10"
    },
    "2": {
      "@type": "SoftwareApplication",
      "identifier": "ggplot2",
      "name": "ggplot2",
      "provider": {
        "@id": "https://cran.r-project.org",
        "@type": "Organization",
        "name": "Comprehensive R Archive Network (CRAN)",
        "url": "https://cran.r-project.org"
      },
      "sameAs": "https://CRAN.R-project.org/package=ggplot2"
    },
    "SystemRequirements": null
  },
  "fileSize": "1007.247KB"
}

GitHub Events

Total
  • Watch event: 3
Last Year
  • Watch event: 3

Committers

Last synced: about 3 years ago

All Time
  • Total Commits: 27
  • Total Committers: 1
  • Avg Commits per committer: 27.0
  • Development Distribution Score (DDS): 0.0
Past Year
  • Commits: 0
  • Committers: 0
  • Avg Commits per committer: 0.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
leonawicz m****z@e****m 27
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: over 2 years ago

All Time
  • Total issues: 0
  • Total pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Total issue authors: 0
  • Total pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
  • olivroy (1)
Top Labels
Issue Labels
Pull Request Labels

Packages

  • Total packages: 2
  • Total downloads:
    • cran 270 last-month
  • Total dependent packages: 3
    (may contain duplicates)
  • Total dependent repositories: 3
    (may contain duplicates)
  • Total versions: 7
  • Total maintainers: 1
cran.r-project.org: trekcolors

Star Trek Color Palettes

  • Versions: 4
  • Dependent Packages: 2
  • Dependent Repositories: 3
  • Downloads: 270 Last month
Rankings
Forks count: 10.8%
Stargazers count: 11.0%
Dependent packages count: 13.7%
Dependent repos count: 16.5%
Average: 20.3%
Downloads: 49.8%
Maintainers (1)
Last synced: 10 months ago
conda-forge.org: r-trekcolors
  • Versions: 3
  • Dependent Packages: 1
  • Dependent Repositories: 0
Rankings
Dependent packages count: 28.8%
Dependent repos count: 34.0%
Average: 39.6%
Stargazers count: 45.8%
Forks count: 49.6%
Last synced: 10 months ago

Dependencies

DESCRIPTION cran
  • R >= 2.10 depends
  • ggplot2 * imports
  • covr * suggests
  • knitr * suggests
  • rmarkdown * suggests
  • testthat * suggests
.github/workflows/R-CMD-check.yaml actions
  • actions/checkout v4 composite
  • r-lib/actions/check-r-package v2 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
.github/workflows/test-coverage.yaml actions
  • actions/checkout v4 composite
  • actions/upload-artifact v4 composite
  • codecov/codecov-action v4 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite