alpha() / Reference

  • size(400,400);
    noStroke();
    color c = color(0, 126, 255, 102);
    fill(c);
    rect(60, 60, 140, 280);
    float value = alpha(c);  // Sets 'value' to 102
    fill(value);
    rect(200, 60, 140, 280);
    
    Image output for example 1