discuss-gnustep
[Top][All Lists]
Advanced

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

Re: is it a bug or a feature?


From: Lloyd Dupont
Subject: Re: is it a bug or a feature?
Date: Tue, 26 Jul 2005 13:18:06 +1000

Idea of fix:
 
 
- (void)getCyan:(float *)cyan
 magenta:(float *)magenta
  yellow:(float *)yellow
   black:(float *)black
   alpha:(float *)alpha
{
    *cyan = *magenta = *yellow = 1-_white_component;
    *black = 0;
    *alpha = _alpha_component;
}
- (void)getHue:(float *)hue
    saturation:(float *)saturation
    brightness:(float *)brightness
  alpha:(float *)alpha
{
    *hue= *saturation = 0;
    *brightness= _white_component;
    *alpha = _alpha_component;
}
- (void)getRed:(float *)red
  green:(float *)green
   blue:(float *)blue
  alpha:(float *)alpha
{
    *red= *green=*blue=_white_component;
    *alpha = _alpha_component;
}
- (void)getWhite:(float *)white
    alpha:(float *)alpha
{
    *white = _white_component;
    *alpha = _alpha_component;
}
 
 
----- Original Message -----
Sent: Tuesday, July 26, 2005 12:48 PM
Subject: is it a bug or a feature?

if I use predefined color, such as
 
NSColor* c = [NSColor blackColor];
 
it will return a GSCalibratedWhiteColor which is a light subclass of NSColor.
therefore, later, when I call
 
[c getRed:&red green:&green blue:&blue alpha:&alpha]
 
I get the default behavior, which is:
 
  [NSException raise: NSInternalInconsistencyException
       format: @"Called getRed:green:blue:alpha: on non-RGB colour"];
 
A bit annoying....
So now I wonder should I:
 
1. consider this a bug and try to fix it?
2. consider this a feature and stop using named color?


_______________________________________________
Discuss-gnustep mailing list
Discuss-gnustep@gnu.org
http://lists.gnu.org/mailman/listinfo/discuss-gnustep

reply via email to

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