W3C home > Mailing lists > Public > whatwg@whatwg.org > April 2012

[whatwg] Adding blending to the canvas API

From: Ashley Gullen <ashley@scirra.com>
Date: Fri, 13 Apr 2012 10:17:02 +0100
Message-ID: <CAABs73jVwQmM3uiHY3Msqn1+s9vgPQ-mQ7x5MQ8sDx6NLHjytQ@mail.gmail.com>
This looks very handy for games as well!  Things like 'screen' work very
nicely for some effects, especially explosions.

Surely you'd want to extend the existing list of globalCompositeOperation
though?  Otherwise you'd have to define how globalCompositeOperation and
globalBlendOperation interact.

Ashley Gullen
Scirra.com


On 12 April 2012 00:39, Rik Cabanier <cabanier at gmail.com> wrote:

> :-)
> They are definitely more familiar to designers but they both have their
> place.
>
> On Wed, Apr 11, 2012 at 4:30 PM, Jeremy Apthorp <jeremya at chromium.org
> >wrote:
>
> > On Wed, Apr 11, 2012 at 4:05 PM, Rik Cabanier <cabanier at gmail.com>
> wrote:
> >
> >> All,
> >>
> >> I'm working on a spec to add blending and compositing through simple CSS
> >> keywords. It is trying to define a generic model that is not specific to
> >> Canvas, HTML or SVG and then lists how the model could be implemented.
> >> We've gotten some comments that this feature would be useful in Canvas
> as
> >> well so I was wondering if it made sense to add it to the canvas API.
> >>
> >> I can see 2 ways of adding this:
> >> 1. extend the list of compositing operators (
> >>
> >>
> http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#compositing
> >> )
> >> with blending. This is what is currently in the draft spec (
> >> https://dvcs.w3.org/hg/FXTF/rawfile/tip/compositing/index.html chapter
> 7)
> >>
> >> 2. create a new attribute on the context called 'globalBlendOperation'
> >> that
> >> takes the same list of blend operations as css (
> >>
> https://dvcs.w3.org/hg/FXTF/rawfile/tip/compositing/index.html#blend-mode
> >> )
> >>
> >> Any thoughts?
> >>
> >
> > This seems much more useful than the existing composite operations :)
> >
>
Received on Friday, 13 April 2012 02:17:02 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 30 January 2013 18:48:07 GMT