discuss-gnustep
[Top][All Lists]
Advanced

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

Re: setting colors


From: Chris B. Vetter
Subject: Re: setting colors
Date: Thu, 30 Oct 2003 10:00:33 -0800

On Thu, 30 Oct 2003 10:40:57 +0300
Aleksandr Skobelev <public-mail@list.ru> wrote:
> "Chris B. Vetter" <chrisv@web4inc.com> writes:
> > On your shell you can call
> >   defaults write NSGlobalDomain windowBackgroundColor "R G B"
> > to set the background for a GNUstep window.
> > R, G, and B are expected to be float values.
> > You can "find" a full list of default settings by browsing the
> > source of -core/gui/Source/NSColor.m
> Thank you. It works almost for all cases. But I still unable to change
> colors for some controls (like NSTabView or NSBox). Is it bug or I've
> missed something?

NSColor keeps all available defaults in an NSMutableDictionary called
colorStrings with default values:

                     lightGray, @"controlBackgroundColor",
                     lightGray, @"controlColor",
                     lightGray, @"controlHighlightColor",
                     white,     @"controlLightHighlightColor",
                     darkGray,  @"controlShadowColor",
                     black,     @"controlDarkShadowColor",
                     black,     @"controlTextColor",
                     darkGray,  @"disabledControlTextColor",
                     gray,      @"gridColor",
                     lightGray, @"headerColor",
                     black,     @"headerTextColor",
                     white,     @"highlightColor",
                     black,     @"keyboardFocusIndicatorColor",
                     lightGray, @"knobColor",
                     gray,      @"scrollBarColor",
                     white,     @"selectedControlColor",
                     black,     @"selectedControlTextColor",
                     lightGray, @"selectedKnobColor",
                     white,     @"selectedMenuItemColor",
                     black,     @"selectedMenuItemTextColor",
                     lightGray, @"selectedTextBackgroundColor",
                     black,     @"selectedTextColor",
                     black,     @"shadowColor",
                     white,     @"textBackgroundColor",
                     black,     @"textColor",
                     lightGray, @"windowBackgroundColor",
                     black,     @"windowFrameColor",
                     white,     @"windowFrameTextColor",
                     //gray,    @"windowFrameColor",
                     //black,   @"windowFrameTextColor",

The colours are NSStrings containing RGB floats:

  white = [NSString stringWithFormat: @"%f %f %f",
                    NSWhite, NSWhite, NSWhite];
  lightGray = [NSString stringWithFormat: @"%f %f %f",
                        NSLightGray, NSLightGray, NSLightGray];
  gray = [NSString stringWithFormat: @"%f %f %f",
                   NSGray, NSGray, NSGray];
  darkGray = [NSString stringWithFormat: @"%f %f %f",
                       NSDarkGray, NSDarkGray, NSDarkGray];
  black = [NSString stringWithFormat: @"%f %f %f",
                    NSBlack, NSBlack, NSBlack];

You may have to play around a bit to see which setting(s) affect NSBox
or NSTabView.

-- 
Chris




reply via email to

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