[Gambas-user] gb.web.gui and Canvas

Benoit Minisini benoit.minisini at gambas-basic.org
Wed Aug 3 14:00:15 CEST 2022


Le 03/08/2022 à 12:54, Bruce Steers a écrit :
> 
> I've tried to implement Gradients and CSS values for fill and stroke 
> styles.  (just images left to support now)
> Made a Gradient.class
> 
> https://gitlab.com/bsteers4/gambas/-/commit/f36bf206d1123df808655d44db0c6f065a6451e5 
> <https://gitlab.com/bsteers4/gambas/-/commit/f36bf206d1123df808655d44db0c6f065a6451e5>
> 
> Respects
> BruceS
> 

You must create a PaintBrush class that mimics the Paint interface of 
GUI components.

That PaintBrush class will be passed to the 'Style' argument of the 
Fill() and Stroke() methods.

Then you add the methods in Paint class to create a color brush (not 
useful, as 'Style' can directly be a color integer value), an image 
pattern brush, a linear gradient brush, and so on.

By the way, I don't think we should support CSS color names in Paint. 
You can't check that a string is really a color name without having a 
huge list under the hood, and the Color class already has enough color 
constants for that.

P.S. I will come back to Paris in three days, I won't be able to read my 
mails before.

Regards,

-- 
Benoît Minisini.


More information about the User mailing list