Skip to content

Commit

Permalink
Like a sunset going down
Browse files Browse the repository at this point in the history
  • Loading branch information
geryan committed May 31, 2024
1 parent 19623ef commit 77e70e2
Show file tree
Hide file tree
Showing 6 changed files with 124 additions and 6 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
^\.Rproj\.user$
^README\.Rmd$
^LICENSE\.md$
^\.github$
1 change: 1 addition & 0 deletions .github/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.html
52 changes: 52 additions & 0 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]

name: R-CMD-check

permissions: read-all

jobs:
R-CMD-check:
runs-on: ${{ matrix.config.os }}

name: ${{ matrix.config.os }} (${{ matrix.config.r }})

strategy:
fail-fast: false
matrix:
config:
- {os: macos-latest, r: 'release'}
- {os: windows-latest, r: 'release'}
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
- {os: ubuntu-latest, r: 'release'}
- {os: ubuntu-latest, r: 'oldrel-1'}

env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes

steps:
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-pandoc@v2

- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
http-user-agent: ${{ matrix.config.http-user-agent }}
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::rcmdcheck
needs: check

- uses: r-lib/actions/check-r-package@v2
with:
upload-snapshots: true
build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")'
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Package: idpalette
Title: Some palettes for the IDEM, IDDU, and ACEFA groups.
Title: Some palettes for the IDEM, IDDU, and ACEFA research groups
Version: 0.0.0.9000
Authors@R:
person("Gerry", "Ryan", , "[email protected]", role = c("aut", "cre"),
Expand Down
47 changes: 44 additions & 3 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -16,32 +16,56 @@ knitr::opts_chunk$set(

# idpalette

Palettes based on the colour schemes for [IDEM](https://www.telethonkids.org.au/our-research/brain-and-behaviour/child-health-analytics-research-program/infectious-disease-ecology-and-modelling/),
[IDDU](https://mspgh.unimelb.edu.au/research-groups/centre-for-epidemiology-and-biostatistics-research/infectious-disease-dynamics), and [ACEFA](https://acefa-hubs.github.io)

<!-- badges: start -->

[![R-CMD-check](https://github.com/idem-lab/idpalette/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/idem-lab/idpalette/actions/workflows/R-CMD-check.yaml)
<!-- badges: end -->

COLOURS FOR EVERYONE *in IDEM, IDDU, ACEFA*

## Installation

You can install the development version of idpalette from [GitHub](https://github.com/) with:
You can install the development version of idpalette from
[GitHub](https://github.com/) with:

``` r
# install.packages("devtools")
devtools::install_github("idem-lab/idpalette")
```

## Using `idpalette`
The function `idpalette` takes arguments:

- `p`, the palette, i.e., `"idem"`, `"iddu"`, or `"acefa"`, and
- `n`, number of colours needed.

These can also be accessed by alias functions for each palette: `idem(n)`,
`iddu(n)`, and `acefa(n)`

If `n` is not specified, the default is the number of colours in the true base
palette, i.e., 7 for IDEM, and 5 for IDDU and ACEFA.

Usage per above calls palettes based on the colours in the group logos. There
are also "official" versions of the palettes, which contain only the four
colours specifically selected for use by the graphic design team.

## Main colours

### IDEM

```{r}
library(idpalette)
idpalette("idem")
```

```{r}
idpalette("idem_official")
```

### IDDU

```{r}
idpalette("iddu")
```
Expand All @@ -51,6 +75,7 @@ idpalette("iddu_official")
```

### ACEFA

```{r}
idpalette("acefa")
```
Expand All @@ -59,8 +84,24 @@ idpalette("acefa")
idpalette("acefa_official")
```

## Alias functions

```{r}
idem()
```

```{r}
iddu()
```

```{r}
acefa()
```

## Your colours your way

As many or as few colours as you want

```{r}
idpalette("iddu", 20)
```
Expand All @@ -85,6 +126,7 @@ ggplot(
colours = idpalette("iddu", 100)
)
```

```{r fig.height= 4}
ggplot(mpg) +
geom_bar(
Expand All @@ -96,4 +138,3 @@ ggplot(mpg) +
scale_fill_manual(values = idpalette("idem")) +
theme_bw()
```

27 changes: 25 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,15 @@

# idpalette

Palettes based on the colour schemes for
[IDEM](https://www.telethonkids.org.au/our-research/brain-and-behaviour/child-health-analytics-research-program/infectious-disease-ecology-and-modelling/),
[IDDU](https://mspgh.unimelb.edu.au/research-groups/centre-for-epidemiology-and-biostatistics-research/infectious-disease-dynamics),
and [ACEFA](https://acefa-hubs.github.io)

<!-- badges: start -->
<!-- badges: end -->

COLOURS FOR EVERYONE *in IDEM, IDDU, ACEFA*
[![R-CMD-check](https://github.com/idem-lab/idpalette/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/idem-lab/idpalette/actions/workflows/R-CMD-check.yaml)
<!-- badges: end -->

## Installation

Expand All @@ -18,6 +23,24 @@ You can install the development version of idpalette from
devtools::install_github("idem-lab/idpalette")
```

## Using `idpalette`

The function `idpalette` takes arguments:

- `p`, the palette, i.e., `"idem"`, `"iddu"`, or `"acefa"`, and
- `n`, number of colours needed.

These can also be accessed by alias functions for each palette:
`idem(n)`, `iddu(n)`, and `acefa(n)`

If `n` is not specified, the default is the number of colours in the
true base palette, i.e., 7 for IDEM, and 5 for IDDU and ACEFA.

Usage per above calls palettes based on the colours in the group logos.
There are also “official” versions of the palettes, which contain only
the four colours specifically selected for use by the graphic design
team.

## Main colours

### IDEM
Expand Down

0 comments on commit 77e70e2

Please sign in to comment.