[Haskell-cafe] Re: [Haskell] ANNOUNCE: colour 0.0.0

roconnor at theorem.ca roconnor at theorem.ca
Fri Oct 24 22:22:12 EDT 2008

On Fri, 24 Oct 2008, Sebastian Sylvan wrote:

> Another useful predefined space which I didn't see is the YCoCg space, which is used in lots of
> compression schemes (like H.264 IIRC).

YCoCg, like HLS and HSV, seems to not really be a colour space because it 
isn't well specified.  A transformation is given from some unknown RGB 

Perhaps I should make a datatype for unknown RGB triple, and create HLS 
HSV, and YCoCg transforms from this type.  I can have toRGB709 and toSRGB 
take and return this unknown RGB triple type.

This would suggest changing sRGB and rgb709 from the type
sRGB :: a -> a -> a -> Colour a


sRGB :: RGB a -> Colour a

so the code "sRGB r g b" becomes "sRGB (RGB r g b)".  That doesn't seem 
very nice.

Also, I could add phantom type annotations to the RGB triple type, 
allowing it to be labeled as linear, or nonlinear, or other information.

Russell O'Connor                                      <http://r6.ca/>
``All talk about `theft,''' the general counsel of the American Graphophone
Company wrote, ``is the merest claptrap, for there exists no property in
ideas musical, literary or artistic, except as defined by statute.''

More information about the Haskell-Cafe mailing list