Jonclayden Shades Versions Save

Simple colour manipulation in R

v1.4.0

2 years ago
  • The package now handles missing values, patching up some of the limitations of the underlying core graphics functions. In particular, shade vectors may contain NAs, and will propagate them through manipulations, while NAs are accepted as pass-through values when updating colour properties.

v1.3.0

5 years ago
  • It is now possible to manipulate palette functions and ggplot2 scales using the colour manipulation functions in this package (#5, #7). When passed one of these objects, a modified wrapper object is returned. This allows colour tweaks to be made to standard scales in ggplot2 plots. See the README for a visual example.
  • The gradient() function now returns a function if its second argument is missing or NULL. This change is complementary to the one above, allowing palette functions to be created.
  • Conversions from HSV to RGB coordinates are now more precise.

v1.2.0

6 years ago
  • There is now support for transparency, which can be queried or modified through the new opacity() function, which functions just like the other colour property functions (#4). Opacity (alpha) values are stored as an attribute with shade objects, and reflected in the RGB hex representation only when less than 1.
  • The scalefac() functional has been added, which multiplies its argument just as delta() adds it. Both functions now accept, and concatenate, multiple arguments for convenience.
  • The usual behaviour of the colour property manipulation functions, which vectorise over both arguments, can be suppressed by wrapping replacement values with the recycle() function, which reverts to a standard R "recycling" scheme with final dimensions matching the original.

v1.1.0

6 years ago
  • The dichromat() function now offers a pass-through (normal colour vision) option, and is also vectorised over its second argument (#3). Some of the coefficients it uses internally are now pre-calculated and cached for efficiency.
  • There is now a print method for vectors of class shade.
  • An empty shade vector is now explicitly an error.
  • The README now includes an example of using shades with ggplot2 (#2), as well as links to several related packages.

v1.0.0

6 years ago
  • 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.