draw2d icon indicating copy to clipboard operation
draw2d copied to clipboard

Draw line using a gradient color

Open dragosslujeru opened this issue 5 years ago • 2 comments

Hello,

I am using draw2d to draw some graphics using go and it's going great. Thank you for the library! I have a usecase where I would need the line I am drawing to use a gradient color instead of a solid color. As an example the line could start green and end red. Can this be done? I've been looking around for a way to achieve this but so far I have come up short. Thank you in advance for any answer.

dragosslujeru avatar Jan 11 '21 03:01 dragosslujeru

Hi @dragosslujeru , there's no gradient support in draw2d and it's not planned to have any soon. You might want to use another library like https://github.com/fogleman/gg/blob/master/gradient.go thanks

llgcode avatar Jan 12 '21 09:01 llgcode

Thank you for the reply. I will look at it.

dragosslujeru avatar Jan 12 '21 09:01 dragosslujeru