cmix {memnet} | R Documentation |
Mixes two colors or matching vectors of colors according to some relative weight and exports the result either in rgb or hex format.
cmix(col_1, col_2, weight, format = "hex")
col_1, col_2 |
character vector of length one or of matching length containing colors either as a color name (see colors), rgb format (see rgb), or hex format. |
weight |
numeric between 0 and 1 specifying the relative mixing weight for color
one. E.g., |
format |
character string specifying the output format. Either |
A vector of length max(length(col_1), length(col_2))
containing the
mixed colors in the specified format.
# mix blue and red with more weight on blue cmix('blue', 'red', .2) # mix blue and red with more weight on red cmix('blue', 'red', .8) # mix blue and red and return as rgb cmix('blue', 'red', .8, format = 'rgb')