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 module, together with the longstanding compositing code.
It’s under the BSD license.