| plotPatchesRGB | R Documentation |
RGB patches are a very common way of comparing color renderings. This function draws rectangular patches, and can also draw triangles formed by omitting one vertex from the rectangle.
plotPatchesRGB( obj, space='sRGB', which='signal', maxColorValue=1,
background='gray50', shape='full', add=FALSE, labels=FALSE, ... )
obj |
an Nx3 matrix of RGBs for N patches, preferably with assigned |
space |
the name of an installed RGB space. When the input RGB is linear, a transfer function of this RGB space is used to convert linear RGB to signal RGB, see Details. |
which |
the meaning of the RGB values in |
maxColorValue |
a positive number used for input RGB scaling, see Details |
background |
the color for the background behind all the patches.
If it is a character string, it is passed directly to |
shape |
If |
add |
if |
labels |
controls how the patches are labeled, using |
... |
additional arguments passed to |
If which='signal' then the input RGBs are converted to hex codes using
rgb() using the maxColorValue argument,
and the space argument is ignored.
If which='scene' or which='display' then the input linear RGBs are normalized
by division by maxColorValue, and then converted to signal RGB using
SignalRGBfromLinearRGB() with the space argument.
The signal RGB is then converted to hex codes using rgb().
If obj is a matrix, or a data.frame without columns LEFT,TOP,WIDTH,HEIGHT,
then the patches are drawn vertically stacked and abutting from top to bottom.
TRUE if successful, and FALSE otherwise
SignalRGBfromLinearRGB(),
installRGB(),
rgb()
set.seed(0)
RGB = round( 255 * matrix( runif(6*3), 6, 3 ) )
plotPatchesRGB( RGB, max=255 )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.