globalAlpha messing me up

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

globalAlpha messing me up

Jason H-3
I am attempting to port an existing canvas system to HTML5. You may have heard of it, its called Qt. Qt has a highly-evolved drawing API that I think you should just copy because it's open source, optimized and proven.


1. Anyway, the specific thing that is currently giving my grief is globalAlpha. This should be split into strokeAlpha and fillAlpha. Now because of this lack of separation, I always have to put out the alpha before any stroke or fill command.
And actually, I'm going to write out all the stroke and fill properties.

2. Additionally I would suggest accepting colors in AARRGGBB format, which would set the alphas accordingly.


3. The other thing that annoys me is "strokeStyle" actually has no style associated with it. In Qt land, this comes out to be able to specify various dash-dottings. Really, strokeStyle is strokeColor. And the same thing goes for fills.



Reply | Threaded
Open this post in threaded view
|

Re: globalAlpha messing me up

Ian Hickson
On Tue, 27 Mar 2012, Jason H wrote:

>
> I am attempting to port an existing canvas system to HTML5. You may have
> heard of it, its called Qt. Qt has a highly-evolved drawing API that I
> think you should just copy because it's open source, optimized and
> proven.
>
> 1. Anyway, the specific thing that is currently giving my grief is
> globalAlpha. This should be split into strokeAlpha and fillAlpha. Now
> because of this lack of separation, I always have to put out the alpha
> before any stroke or fill command. And actually, I'm going to write out
> all the stroke and fill properties.

Since this part is already widely implemented, I doubt we will change it
at this stage.


> 2. Additionally I would suggest accepting colors in AARRGGBB format,
> which would set the alphas accordingly.

We just use the CSS syntax, so I recommend approaching the CSSWG about
this.


> 3. The other thing that annoys me is "strokeStyle" actually has no style
> associated with it. In Qt land, this comes out to be able to specify
> various dash-dottings. Really, strokeStyle is strokeColor. And the same
> thing goes for fills.

I've added dashes to the API:

   http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#line-styles

HTH,
--
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'