diff --git a/NEWS.md b/NEWS.md index 2eae1cc..90f0934 100644 --- a/NEWS.md +++ b/NEWS.md @@ -4,6 +4,5 @@ # tinter 0.1.0 -* Added exported functions chk_color/chk_colour and vld_color/vld_colour. -* Resolved issue of 'class(matrix(...)) gives a vector of length two and conditions of length -greater than one in 'if' or 'while' give an error'. +* Added exported functions `chk_color`/`chk_colour` and `vld_color`/`vld_colour`. +* Resolved issue in r devel build caused by testing condition on vector of length two. diff --git a/R/vld.R b/R/vld.R index 0e8b2bb..23b4acd 100644 --- a/R/vld.R +++ b/R/vld.R @@ -5,7 +5,7 @@ #' #' @inheritParams chk::chk_true #' @return A flag indicating whether the object was validated. -#' @seealso \code{\link{chk_color}()} +#' @seealso [chk_color()] #' @name vld_color NULL diff --git a/README.Rmd b/README.Rmd index 44f3ac6..de908a0 100644 --- a/README.Rmd +++ b/README.Rmd @@ -36,7 +36,6 @@ knitr::opts_chunk$set( ```{r global} library(tinter) hex <- "#335CAC" - ``` ```{r colour, echo = FALSE, fig.width = 2, fig.height = 0.5} @@ -81,7 +80,6 @@ tinter(hex, direction = "tints") ```{r tints, echo=FALSE} tinter_plot(tinter(hex, direction = "tints")) - ``` ```{r, results="hide"} @@ -117,7 +115,7 @@ library(sf) nc <- st_read(system.file(package = "sf", "shape/nc.shp")) ggplot(data = nc) + - geom_sf(aes(fill = AREA), colour = "white", lwd = 0.05) + + geom_sf(aes(fill = AREA), colour = "white", lwd = 0.04) + # colours from tinter scale_fill_gradientn(colours = tinter(hex)) + theme_void() + diff --git a/README.md b/README.md index 36a7976..b5ca3bd 100644 --- a/README.md +++ b/README.md @@ -77,7 +77,7 @@ library(sf) nc <- st_read(system.file(package = "sf", "shape/nc.shp")) ggplot(data = nc) + - geom_sf(aes(fill = AREA), colour = "white", lwd = 0.05) + + geom_sf(aes(fill = AREA), colour = "white", lwd = 0.04) + # colours from tinter scale_fill_gradientn(colours = tinter(hex)) + theme_void() + diff --git a/docs/404.html b/docs/404.html new file mode 100644 index 0000000..f8be9b0 --- /dev/null +++ b/docs/404.html @@ -0,0 +1,156 @@ + + + +
+ + + + +Copyright (c) 2018 Poisson Consulting Ltd.
-Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the âSoftwareâ), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
-THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+THE SOFTWARE IS PROVIDED âAS ISâ, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Lighten colour.
-lighten(x, amount)- +
A number from 0 to 1. |
A vector of modified colours.
-#> [1] "#F5F5FF" "#EBEBFF" "#E1E1FF" "#D8D8FF" "#CECEFF" "#CECEF5" "#CECEEB" #> [8] "#CECEE1" "#CECED8"
Generate shades, tints or both from a colour.
-tinter(x, steps = 5, crop = 1, direction = "both", adjust = 0)- +
A number between -1 and 1. Values between 0 and -1 increasingly darken colour; values between 0 and 1 increasingly lighten colour. |
A vector of colours.
-- + + + diff --git a/docs/reference/vld_color.html b/docs/reference/vld_color.html new file mode 100644 index 0000000..278fe8a --- /dev/null +++ b/docs/reference/vld_color.html @@ -0,0 +1,193 @@ + + + + + + + + +tinter("blue")#> [1] "#CCCCFF" "#9999FF" "#6666FF" "#3333FF" "#0000FF" "#0000CC" "#000099" @@ -153,32 +165,30 @@Examp #> [8] "#FA6A5C" "#E15F52" "#C85449" "#AF4A40" "#953F37" "#7D352E" "#632A24" #> [15] "#4A1F1B"
tinter("#fa6a5c", direction = "tints")#> [1] "#FEE1DE" "#FDC3BD" "#FBA59D" "#FB877C" "#FA6A5C"
Validates whether x is a string (non-missing character vector of length 1) +that specifies a color.
+vld_color(x) + +vld_colour(x)+ +
x | +The object to check. |
+
---|
A flag indicating whether the object was validated.
+vld_color
: Validate Color String
vld_colour
: Validate Colour String
++# vld_color +vld_color("blue")#> [1] TRUEvld_color("glue")#> [1] FALSE+# vld_color +vld_colour("blue")#> [1] TRUEvld_colour("glue")#> [1] FALSE