Index: NSColor.m =================================================================== RCS file: /cvsroot/gnustep/gnustep/core/gui/Source/NSColor.m,v retrieving revision 1.48 diff -u -r1.48 NSColor.m --- NSColor.m 30 Jan 2004 19:49:00 -0000 1.48 +++ NSColor.m 30 Sep 2004 12:58:45 -0000 @@ -27,6 +27,8 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#include + #include "config.h" #include #include @@ -170,7 +172,17 @@ NSString *gray; NSString *darkGray; NSString *black; - + + double gamma; + NSUserDefaults *ud; + + ud = [NSUserDefaults standardUserDefaults]; + if ([ud stringForKey: @"GSSystemColorGamma"]) + gamma = [[ud stringForKey: @"GSSystemColorGamma"] doubleValue]; + else + gamma = 1.6; + gamma = 1.0 / gamma; + // Set up a dictionary containing the names of all the system colors // as keys and with colors in string format as values. white = [NSString stringWithFormat: @"%f %f %f", @@ -238,11 +250,25 @@ NSString *cs; NSColor *c; - if ([systemColors colorWithKey: r]) - continue; +/* if ([systemColors colorWithKey: r]) + continue;*/ cs = [colorStrings objectForKey: r]; c = [NSColorClass colorFromString: cs]; + c = [c colorUsingColorSpaceName: NSCalibratedRGBColorSpace]; + { + double r=[c redComponent]; + double g=[c greenComponent]; + double b=[c blueComponent]; + double a=[c alphaComponent]; + r = pow(r, gamma); + g = pow(g, gamma); + b = pow(b, gamma); + c = [NSColorClass colorWithCalibratedRed: r + green: g + blue: b + alpha: a]; + } NSCAssert1(c, @"couldn't get default system color %@", r);