[Haskell-cafe] Colour tutorial (Was: AC-Vector, AC-Colour and AC-EasyRaster-GTK)

Derek Elkins derek.a.elkins at gmail.com
Sat Jul 11 13:54:09 EDT 2009

On Fri, Jul 10, 2009 at 12:42 AM, <roconnor at theorem.ca> wrote:
> On Thu, 9 Jul 2009, roconnor at theorem.ca wrote:
>> You can use by lib without worrying about the CIE.  You can use my library
>> without ever importing or using the word CIE.  However, the CIE stuff is
>> there for those who need it.
>> Perhaps I (maybe with some help) need to make a tutorial on the haskell
>> wiki to try to make it less intimidating.
> Okay, I threw together a quick introduction at
> <http://www.haskell.org/haskellwiki/Colour>.  Any changes, comments,
> corrections, and addtions are welcome.  It's a wiki!
> The word CIE does occur at all in the document.

I read this and it irks me that opaque is not a monoid homomorphism
despite being the natural injection of non-transparent colours into
semi-transparent colours with pureColour being the projection back.
[Incidentally, you have a typo in pureColour, ac `over` mempty should
be ac `over` black or opaque black presumably, or even opaque mempty,
which I think was what you were going for, illustrating my point.]
It's like defining mappend on Integers as (+) and on Reals as (*);
actually, I think this is very close to what is actually happening.

More information about the Haskell-Cafe mailing list