Closed hamoid closed 4 years ago
I went for changing linear gradient and radial gradient as little as possible: https://github.com/openrndr/orx/pull/139
Note: the current approach centers the gradient on the shape being drawn (using it's bounding box), instead of what I planned above, which was to specify either two points (for a linear gradient) or a center and a radius (for a radial gradient).
Each approach can have its uses, but for now I chose to follow what is already implemented.
For linear, maybe pass
startPoint
,endPoint
,colorArray
,positionsArray
. This last variable should contain an array of normalized values to indicate where between startPoint and endPoint the color is located.For radial, replace
positionsArray
withradiiArray
? Specifycenter
andcolorArray
.Use a simple linear interpolation of colors?