Navigation
Synopsis Create a color from a red, green and blue contribution.
Function
  1. Color rgb(int red, int green, int blue)
  2. Color rgb(int red, int green, int blue, real alpha)
Description Create a color from a red, green and blue contribution each in the range [0,255]. An optional transparency alpha may be given between 0.0 (completely opaque) and 1.0 (completely transparent).
Examples
b1 = box([size(50), fillColor(rgb(255,0,0))]);
b2 = box([size(50), fillColor(rgb(0,255,0))]);
b3 = box([size(50), fillColor(rgb(0,0,255))]);
b4 = box([size(50), fillColor(rgb(100,0,100))]);
boxes = [b1, b2, b3, b4];
render(hcat(boxes));
gives: h1
Is this page unclear, or have you spotted an error? Please add a comment below and help us to improve it. For all other questions and remarks, visit ask.rascal-mpl.org.