[Top][All Lists]

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

Work on NSColor

From: Fred Kiefer
Subject: Work on NSColor
Date: Mon, 01 Jan 2001 23:21:24 +0100

I would like to discuss some changes on NSColor. 

NSColor is currently a concrete class capable to store all the possible
values for all different NSColor types. I would like to change NSColor
into an abstract class with one concrete subclass per colour space. So
we would have calibrated RGB colours and device specific RGB colours and
all the other types each coming from a different class (all inheriting
from NSColor).

What would be the benefit of this? The structure of those classes would
be closer to the documentation, all objects would be smaller and
additional colour classes would fit in easier (Including named colours,
which are currently not supported). NSColor objects would really be
immutable. But the biggest benefit would be that colours for different
devices would later on really be specific for that device.

On the other hand there are of course some drawbacks:
Converting a colour to a different colour space would cost each time not
just once. (Or we have to implement some kind of conversion caching)

The changes in more detail: We will have different concrete classes for 
- calibrated RGB 
- device specific RGB
- calibrated Grey
- device specific Gary
- device specific CMYB
- named colours

RGB colours would include the corresponding HSB values.
The [set] method would convert a calibrated or named colour to the
corresponding device specific colour for the current output device and
[set] that.
Converting a named colour (and thereby also setting) a named colour
would involve a lookup at the corresponding colour list.

Beside that change (that I will perform if nobody vetos within the next
days) there is a smaller change that I would also like to do. The system
colours should also be read in from a file colour list (This overwriting
the colours in the library code which should all be created directly in
the [initialize] method, as colours are than small objects). This way
changes to system colours could be made permanent by a configuration
program without changing the code of the library.

To raise your interest in colours, here is something more: I am
currently working on very simple implementations of system colour
pickers as loadable bundles. As I have only seen the real ones once on
Richard's laptop, they will look very different. And as I am not good at
icon design I still lack some bitmaps to use as the selector for them.
Those bitmaps should be 36 to 40 pixels with transparent background. And
I promise to write every colour picker for which I get a decent icon
within the next two weeks from now! (An outline of the interface
components to use would also be nice, currently I only did RGB and HSB
as they require only three sliders each) I am also reworking the
NSColorPanel gmodel into code, as there are some elements missing (e.g.
the set button) and we don't have anything to edit gmodels.

reply via email to

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