-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.Rmd
166 lines (106 loc) · 4.93 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "80%"
)
asciicast::init_knitr_engine(
startup = quote({
library(cubepalette)
set.seed(1) }),
echo = TRUE,
echo_input = FALSE
)
```
# cubepalettes
<!-- badges: start -->
<!-- badges: end -->
Colour and palettes as defined in the Cube Group Brand guidelines.
The main purpose of cubepalette is to enable Cube Group staff to use the colours and palettes defined in the brand guidelines within R.
cubepalette was created with the **palettes** package, which provides a comprehensive library for colour vectors and colour palettes using a new family of colour classes (`palettes_colour`, and `palettes_palette`) that always print as hex codes with colour previews. Colour palette packages created with palettes have access to the following capabilities, all without requiring you to write any code: formatting, casting and coercion, extraction and updating of components, plotting, colour mixing arithmetic, and colour interpolation.
See the following vignettes to learn how to use cubepalletws with other packages:
- [Using palettes with ggplot2](https://mccarthy-m-g.github.io/palettes/articles/ggplot2.html)
- [Using palettes with gt](https://mccarthy-m-g.github.io/palettes/articles/gt.html)
- [Using palettes with biscale](https://mccarthy-m-g.github.io/palettes/articles/biscale.html)
- [Compatibility with other colour packages](https://mccarthy-m-g.github.io/palettes/articles/compatibility.html)
## Included Colours
The cube palettte includes three colours green, orange, grey. These are supported by light and dark shades.
```{r echo=FALSE, out.height="30px"}
library(cubepalette)
plot(cube_colours)
```
### Primary colours
Cube Group's colour palette uses modern and distinctive tones to convey corporate warmth.
### Cube Green
```{r echo=FALSE, out.height="30px"}
library(cubepalette)
plot(cube.darkgreen)
```
`cube.darkgreen` is used in majority, bringing maturity and a seriousness when needed.
### Cube Orange
```{r echo=FALSE, out.height="30px"}
plot(cube.lightorange)
```
`cube.lightorange` adds warmth, livening up layouts and highlighting key information.
### Cube Grey
```{r echo=FALSE, out.height="30px"}
plot(cube.grey)
```
`cube.grey` is used as a neutral background colour.
## Secondary colours
### Cube Green, Orange and White
The `cube.green`, `cube.orange` and `cube.white` comprise the secondary colours
## Tertiary colours
### Cube Green, Orange and White
The `cube.lightgreen`, `cube.darkorange` and `cube.black` comprise the tertiary colours
`cube.black` and `cube.white` are convenience names for `black` and `white` that allow for consistent syntax when using the cubepalette.
## Installation
You can install the development version of cubepalette from [GitHub](https://github.com/) with:
``` r
# install.packages("devtools")
devtools::install_github("zerogetsamgow/cubepalette")
```
## Usage
```{r}
library(cubepalette)
```
cubepalette comes with a set of `r length(cube_palettes_discrete)` discrete colour palettes, and `r length(cube_palettes_tints)` sequential colour palettes, which can be accessed from the following R objects:
- `cube_palettes_discrete` for discrete palettes
- `cube_palettes_tints` for sequential palettes
- `cube_palettes` for all palettes
### Discrete
Discrete palettes for use with various backgrounds are available. `dark`, `light` and `other` have been compiled to work on backgrounds composed of colours from the Cube Group brand guideline.
```{r plot-cube-palettes-discrete}
plot(cube_palettes_discrete)
```
### Tints
For long form documents infographics and charts, tints from the Cube Group colour palette can be used in 20 per cent increments. `cube_palettes_tints` is populated with compliant `greens`, `oraness` and `greys`.
A broader palette - `darkoranges` - is included for greater variation/increments where required.
```{r plot-cube-palettes-tints}
plot(cube_palettes_tints)
```
Palettes can be subset using `[`, `[[`, and `$`.
- To extract one or more palettes use `[`:
```{r extract-palette}
plot(cube_palettes_tints[c("greens", "greys")])
```
- To extract a single palette as a colour vector use `[[` or `$`:
```{r extract-vector-1}
plot(cube_palettes_tints[["oranges"]])
```
```{r extract-vector-2}
plot(cube_palettes_tints$darkoranges)
```
- To get names of palettes use `names()`:
```{r}
names(cube_palettes_tints)
```
## Cube pink
`cubepalette` includes a colour `cube.pink` that is deprecated. `cube.lightorange` is the preferred name for this colour.
## Documentation
See also documentation for the palettes package at [`https://mccarthy-m-g.github.io/palettes/`](https://mccarthy-m-g.github.io/palettes/reference/index.html) or in the installed package: `help(package = "palettes")`.