Releases: jonclayden/shades
Releases · jonclayden/shades
v1.4.0
- The package now handles missing values, patching up some of the limitations
of the underlying core graphics functions. In particular, shade vectors may
containNA
s, and will propagate them through manipulations, whileNA
s are
accepted as pass-through values when updating colour properties.
v1.3.0
- 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 inggplot2
plots. See the README for a
visual example. - The
gradient()
function now returns a function if its second argument is
missing orNULL
. 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
- There is now support for transparency, which can be queried or modified
through the newopacity()
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
asdelta()
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 therecycle()
function, which reverts to a standard R
"recycling" scheme with final dimensions matching the original.
v1.1.0
- 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 classshade
. - An empty
shade
vector is now explicitly an error. - The README now includes an example of using
shades
withggplot2
(#2), as well as links to several related packages.
v1.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 ofhue()
anddelta()
.hue(x, delta(y))
is the equivalent of the
oldhueshift(x,y)
, anddelta()
can also be used with other colour properties. - New colour property functions
lightness()
andchroma()
have been added. - Dimensions are now set when two or more colour properties are changed, and
theswatch()
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.