rgbToColors.Colors: Converts RGB values to colors

Description Usage Arguments Details Value See Also Examples

Description

Convert any (R,G,B) values in to color string of form "#rrggbb".

Usage

1

Arguments

x

(integer) matrix with three rows; red, green and blue.

...

Not used.

Details

This method is just a wrapper for rgb2col() in the R.base package.

Value

Returns (hexadecimal) color strings.

See Also

*colorsToRGB(). col2rgb, rgb. For more information see Colors.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
  rgb <- Colors$colorsToRGB(c(6, "blue", "#3366ff"))
  print(rgb)

  #        [,1] [,2] [,3]
  #  red    255    0   51
  #  green    0    0  102
  #  blue   255  255  255

  col <- Colors$rgbToColors(rgb)
  print(col)
  # [1] "#FF00FF" "#0000FF" "#3366FF"

HenrikBengtsson/R.graphics documentation built on May 6, 2019, 11:53 p.m.