Re: Mutable NSColor?
Re: Mutable NSColor?
- Subject: Re: Mutable NSColor?
- From: Rob Rix <email@hidden>
- Date: Mon, 24 Sep 2001 09:28:20 -0400
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
If you only need to ever work with ARGB components, then perhaps a simple
helper class would be better than trying to subclass. Your helper class
would simply maintain an NSColor* data member:
You then just simply maintain the single NSColor object.
There are disadvantages with this approach though...namely that you cant
pass such objects in place of NSColor. I'm not too keen on classes
posing as others, but I think that requires subclassing?
Yeah, posing requires subclassing.
What I ended up doing was similar: I made a class which manages four float
values (r, g, b, a). It was pretty trivial to write, and it can translate
to and from NSColor instances as needed as well. It's working very well,
and doesn't seem particularly hackish to me. I just wish AppKit provided a
mutable NSColor class...
- -- Rob
"I think... I think it's in my basement... Let me go upstairs and
check." -- Escher
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (Darwin)
Comment: For info see
http://www.gnupg.org
iD8DBQE7rzUAnZTWcucI1tgRAvX/AKC4U+Y+dRFdbYAEU8wTmYgiSaCxOgCeLXJc
fWuYUU0mrVApNZlatdSLSzs=
=YOZM
-----END PGP SIGNATURE-----