chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Chicken-users] canvas-draw and colors


From: Matt Welland
Subject: [Chicken-users] canvas-draw and colors
Date: Sat, 16 Jul 2016 12:31:39 -0700

I have the feeling I've already asked this but cannot find the email thread.

For canvas-draw colors are longints. There are convenience functions provided by canvas-draw according to the docs at http://webserver2.tecgraf.puc-rio.br/cd/ but they seem not to be accessible from the egg.

This snippet seems to work:

(define (vg:rgb->number r g b #!key (a 0)) (u32vector-ref (blob->u32vector (u8vector->blob (list->u8vector (list a r g b)))) 0))

But it feels rather clumsy and non-trivial for a beginner. Is there a better or at least simpler way?

Thanks.

Matt
-=-

reply via email to

[Prev in Thread] Current Thread [Next in Thread]