Sqhue Gradient Alpha


  size(400, 100);
  color skyBlue = color(0x87, 0xCE, 0xEB); // Equivalent of the CSS color #87CEEB
  background(skyBlue); 
  
  float left_margin = 10;
  float top_margin = 20;
  float w = width - left_margin*2;
  float h = height - top_margin*2;
  
  colorMode(HSB, 1);
  
  for (int i = 0; i < h; ++i) {
    float ratio = i/h;
    float hue = ratio*ratio;
    float saturation = 1;
    float brightness = 1;
    float alpha = sin( PI*ratio ) * 1.5;   // <-- WE COMPUTE THE ALPHA HERE, USING A SINE WAVE. 
  
    stroke( hue, saturation, brightness, alpha );
    line(left_margin, top_margin+i, left_margin+w, top_margin+i);
  }