Learn R Programming

colorSpec (version 0.5-3)

plotPatchesRGB: Plot Patches defined by Linear RGB

Description

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.

Usage

plotPatchesRGB( obj, normalize=FALSE, gamma='sRGB', background='gray50', labels=TRUE, shape='full', add=FALSE )

Arguments

obj
an Mx3 matrix of linear RGBs for M patches, with assigned rownames. Or a data frame containing a matrix column with the exact name 'RGB', also with assigned rownames. If the data frame has optional columns LEFT,TOP,WIDTH,HEIGHT then these are used to draw the patches. The Y coordinates increases going down the page.
normalize
If TRUE then all RGBs are scaled so their maximum is 1
gamma
either the string 'sRGB' or a positive number giving the gamma function of the display; see DisplayRGBfromLinearRGB for details.
background
the color for the background behind all the patches
labels
if TRUE then the rownames are drawn using text.
shape
If shape='full' (the default) then the full rectangle is drawn. If 'half' then the rectangle is shrunk to 1/2 size, and with the same center. If shape is one of 'left', 'right', 'bottom', 'top' then only a half-rectangle is drawn, but keeping the specified side. If shape is one of 'topleft', 'topright', 'bottomleft', 'bottomright', then only a triangular half of the rectangle is drawn, but keeping the specified vertex.
add
if TRUE then the patches are added to an existing plot.

Value

TRUE if successful, and FALSE otherwise

Details

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. See the blueflame vignette for examples. And see the gallery vignette for examples of a data frame with those columns.

See Also

DisplayRGBfromLinearRGB