How to create a diagonal line

Hello,

I created a custom line from concepts gleaned here:
https://processing.org/examples/rgbcube.html

image
image

I added an alpha to the color to have it fade away.