Description Usage Arguments Details Value Examples
validateHex
returns if a string vector contains color representations in hexadecimal format.
1 | validateHex(string, shorthand = FALSE, ignore.case = FALSE)
|
string |
String vector. |
shorthand |
A logical scalar. If TRUE, the validation is performed against the shorthand notation and if FALSE, validation is performed against the normal notation. |
ignore.case |
A logical scalar. If FALSE, the validation is case sensitive and if TRUE, case is ignored during validation. |
This function validates a given hexadecimal color representation. It can check the normal hexadecimal notation (e.g. #FFFFFF) or the shorthand notation (e.g. #FFF).
Returns a logical vector of the same length as the string
input.
1 2 3 4 5 6 7 8 | validateHex("#FFFFFF")
validateHex("#FFF")
validateHex("#FFF", shorthand = TRUE)
validateHex("#ffffff")
validateHex("#ffffff", ignore.case = TRUE)
validateHex(c("#FFFFFF","asdf"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.