alicetril...@gmail.com
unread,Jul 28, 2021, 7:37:37 PM7/28/21You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
As an experiment to better understand GOOPS, I am currently writing a program in Guile using Guile-SDL2 and GOOPS, and as part of this I am implementing a simple wrapper class for RGBA values. I was looking to see if there was any way in GOOPS to enforce (via saturation) value boundaries of 0-255 for the individual color gradients. The simple wrapper class as I have it now is:
--------------------------------------------------------------------
(define-class <rgba-color>
(red #:accessor red-gradient
#:init-keyword #:r)
(green #:accessor green-gradient
#:init-keyword #:g)
(blue #:accessor blue-gradient
#:init-keyword #:b)
(alpha #:accessor alpha-gradient
#:init-keyword #:a))
--------------------------------------------------------------------
I know that this is a bit clumsy as it is, and I am not certain how useful this even will be, but I thought that it would make sense to wrap these values rather than dealing with the bare numerical values. I might switch to a simpler list or vector-based approach instead of a class if there's no straightforward way to enforce this pre-req in GOOPS.