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

Bruce Steers bsteers4 at gmail.com
Wed Aug 3 14:36:16 CEST 2022


On Wed, 3 Aug 2022 at 13:01, Benoit Minisini <
benoit.minisini at gambas-basic.org> wrote:

> 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.
>

Okay so like the PaintBrush would be gambas version of the fillStyle or
strokeStyle style



> 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.
>

I think it'll be okay , image patterns was the next task, currently got
gb.integer CSS and gradient , 3 out of 4 is cool :)
going to handle images by using either src URL's or existing loaded img
objects.
Will look into making what i've done so far work your way through the
Paint.class

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.
>

I think it's cool, we could add in documentation that it's down to the
programmer to use correct names if using CSS as they are not checked for
validity.
gotta love the option :)


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

Hopefully i will have some code for you to facepalm at by the time you
return home ;)

Bon voyage

BruceS
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20220803/ec2fa84f/attachment.htm>


More information about the User mailing list