Learn R Programming

munsellinterpol (version 2.0.1)

xyz2srgb: Convert XYZ coordinates to sRGB

Description

Convert XYZ coordinates to sRGB

Usage

xyz2srgb( XYZ, maxValue=255 )

Arguments

XYZ

a numeric Nx3 matrix with CIE XYZ coordinates in the rows, or a vector that can be converted to such a matrix, by row. The XYZ are for viewing in an environment with Illuminant D65 (from the sRGB standard) with Y=100.

maxValue

maximum value of sRGB for display. Other popular values are 1, 1023, and 65535.. Even when 1, they are still taken to be non-linear display values.

Value

a data.frame with N rows and these columns

sRGB

non-linear sRGB coordinates. All values are clamped to the appropriate cube, e.g. \([0,255]^3\). Values are not rounded.

OutOfGamutFlag

logical vector, TRUE means the result was out of gamut (the cube) before clamping it

References

Wikipedia. sRGB. https://en.wikipedia.org/wiki/SRGB

Logicol S.r.l., 2014 EasyRGB color search engine http://www.easyrgb.com/

See Also

srgb2xyz()

Examples

Run this code
# NOT RUN {
xyz2srgb( c(80.310897, 90.306510, 84.613450) )
##      sRGB.R   sRGB.G   sRGB.B OutOfGamutFlag
##  1 230.1676 249.4122 225.2472          FALSE
# }

Run the code above in your browser using DataLab