Skip to content

Commit

Permalink
Final updates for 1.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
jonclayden committed Jan 10, 2018
1 parent f89343d commit 2b3e3a9
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 7 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: shades
Version: 0.2.0
Date: 2016-09-23
Version: 1.0.0
Date: 2018-01-10
Title: Simple Colour Manipulation
Author: Jon Clayden
Maintainer: Jon Clayden <code@clayden.org>
Expand Down
2 changes: 1 addition & 1 deletion LICENCE
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
YEAR: 2016
YEAR: 2018
COPYRIGHT HOLDER: Jon Clayden
ORGANIZATION: University College London
21 changes: 21 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,27 @@ Significant changes to the shades package are laid out below for each release.

===============================================================================

VERSION 1.0.0

- Support for two new colour spaces has been added: LMS, a direct
representation of the response levels of each of the three colour receptor
types in the eye; and LCh, a polar representation of Lab space.
- The new dichromat() function can be used to simulate colour blindness.
- The gradient() function now additionally supports predefined colour maps from
matplotlib and ColorBrewer. Its second argument is now interpreted a little
differently.
- The hueshift() function has been removed, in favour of the more general
combination of hue() and delta(). hue(x, delta(y)) is the equivalent of the
old hueshift(x,y), and delta() can also be used with other colour properties.
- New colour property functions lightness() and chroma() have been added.
- Dimensions are now set when two or more colour properties are changed, and
the swatch() visualisation function plots multidimensional shades in a grid.
- There is now a rev() method for shades.
- The all.equal() method for shades now passes on its ellipsis argument when
checking colour coordinates.

===============================================================================

VERSION 0.2.0

- The package has been reworked to use functions from base R to warp colour
Expand Down
4 changes: 2 additions & 2 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@ Here, we are using the `swatch` function to visualise a set of colours as a seri
Similarly, we can create a set of new colours by changing the brightness and saturation levels of some base colours, and make the code more readable by using the [`magrittr` pipe operator](https://github.com/smbache/magrittr).

```{r saturation}
library(magrittr)
library(shades); library(magrittr)
c("red","blue") %>% brightness(0.6) %>% saturation(seq(0,1,0.25)) %>% swatch
```

This operation takes the original two colours, reduces their brightness to 60%, assigns a whole series of saturation levels to the result, and then passes it to `swatch` for visualisation. Notice that the final shades are arranged in two rows for convenience, since there are two axes of variation.
This operation takes the original two colours, reduces their brightness to 60%, assigns a whole series of saturation levels to the result, and then passes it to `swatch` for visualisation. Notice that the pipeline is combinative (like the base function `outer`), returning each combination of parameters in a multidimensional array. The final shades are arranged in two rows by `swatch`, for convenience.

Any of these gradients can be directly passed to a standard graphical function, to be used as a colour scale. However, when choosing a colour scale, it is helpful to bear in mind that some viewers may have a colour vision deficiency (colour blindness), making it harder for them to distinguish certain colours and therefore to see a continuous scale. The `dichromat` function can be used to simulate this.

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,13 @@ Similarly, we can create a set of new colours by changing the brightness and sat


```r
library(magrittr)
library(shades); library(magrittr)
c("red","blue") %>% brightness(0.6) %>% saturation(seq(0,1,0.25)) %>% swatch
```

![plot of chunk saturation](tools/figures/saturation-1.png)

This operation takes the original two colours, reduces their brightness to 60%, assigns a whole series of saturation levels to the result, and then passes it to `swatch` for visualisation. Notice that the final shades are arranged in two rows for convenience, since there are two axes of variation.
This operation takes the original two colours, reduces their brightness to 60%, assigns a whole series of saturation levels to the result, and then passes it to `swatch` for visualisation. Notice that the pipeline is combinative (like the base function `outer`), returning each combination of parameters in a multidimensional array. The final shades are arranged in two rows by `swatch`, for convenience.

Any of these gradients can be directly passed to a standard graphical function, to be used as a colour scale. However, when choosing a colour scale, it is helpful to bear in mind that some viewers may have a colour vision deficiency (colour blindness), making it harder for them to distinguish certain colours and therefore to see a continuous scale. The `dichromat` function can be used to simulate this.

Expand Down

0 comments on commit 2b3e3a9

Please sign in to comment.