Tag Archives: Graphics

Storing Colours in 31 bits (Part 2)

Jean-Baptiste Rouquier rose to the challenge in my last post: to provide a fast way of storing premultiplied colours in OCaml’s 31bit integers (see his post here). With his kind permission, I’ve included this code (somewhat optimized) in the Colour … Continue reading

Posted in Uncategorized | Tagged , | Leave a comment

Storing Colours in 31 bits (Part One)

For rendering vector graphics scenes, colours are usually stored with what we call “premultiplied” or “associated” alpha. For instance, opaque dark red is stored as: 0.5, 0, 0, 0.5 (R * A, G * A, B * A, A) instead … Continue reading

Posted in Uncategorized | Tagged , | Leave a comment