Re: [Fxruby-users] subclassing FXColor
Status: Inactive
Brought to you by:
lyle
From: Lyle J. <ly...@kn...> - 2004-01-31 15:07:57
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Jan 30, 2004, at 5:29 PM, meinrad recheis wrote: > id like to subclass FXColor to add some more functionality. like this: > > class Color < Fox::FXColor > def initialize r, g, b > end > end > > but i don't know how to subclass Bignum (that is what FXRGB returns > ...) > how could i do this to integrate with fxruby? Fox::FXColor should really be a Ruby module and not a class; you can't create instances of it and use them in any meaningful way. And as you already noted, we already have a way to construct color values from the red, green and blue (and optionally alpha) components, e.g. color = Fox.FXRGB(r, g, b) or color_with_some_alpha = Fox.FXRGBA(r, g, b, a) It's not clear what advantage a full-blown FXColor class would offer. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (Darwin) iD8DBQFAG8S2FXV/hD6oMd0RAk8PAJ4oeFiVMEqLxK2TS/Cl5aspqMyBkQCffDQs 6LS+dXpYVkI7LzeluNxjaxU= =sL3l -----END PGP SIGNATURE----- |