[][src]Static p5_sys::global::specularColor

pub static specularColor: SpecularColorInternalType

Set's the color of the specular highlight when using a specular material and specular light.

This method can be combined with specularMaterial() and shininess() functions to set specular highlights. The default color is white, ie (255, 255, 255), which is used if this method is not called before specularMaterial(). If this method is called without specularMaterial(), There will be no effect.

Note: specularColor is equivalent to the processing function lightSpecular.

Examples

function setup() {
  createCanvas(100, 100, WEBGL);
  noStroke();
}

function draw() {
  background(0);
  shininess(20);
  ambientLight(50);
  specularColor(255, 0, 0);
  pointLight(255, 0, 0, 0, -50, 50);
  specularColor(0, 255, 0);
  pointLight(0, 255, 0, 0, 50, 50);
  specularMaterial(255);
  sphere(40);
}

Overloads

v1 red or hue value relative to the current color range

v2 green or saturation value relative to the current color range

v3 blue or brightness value relative to the current color range


value a color string


gray a gray value


values an array containing the red,green,blue & and alpha components of the color


color the ambient light color