powered by
RGBColorPlane constructor taking a 3- or 4-column numeric matrix of RGB(A) colors in the 0-255 range.
matrix
RGBColorPlane(clr)
a new RGBColorPlane instance
RGBColorPlane
a matrix of colors where the first column is red, second column is green, third column is blue, and optional fourth column is alpha.
rgba_cmat <- rbind(c(255,0,0,255), c(0, 255, 0, 255), c(0, 0, 255, 0)) cp <- RGBColorPlane(rgba_cmat) stopifnot(all(cp@clr[1,] == c(255,0,0,255)))
Run the code above in your browser using DataLab