[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
NSColor question
From: |
Chris B. Vetter |
Subject: |
NSColor question |
Date: |
Mon, 23 Feb 2004 17:21:51 -0800 |
Hi,
I was trying to create a splash window, you know like Acroread displays
during startup. For that, I figured to create a transparent window and
add a content view that draws an irregular shape in -drawRect:
Before working on the view I tried to create the transparent window,
using the following:
color = [NSColor clearColor];
window = [[NSWindow alloc] initWithContentRect: rect
styleMask: NSBorderlessWindowMask
backing: NSBackingStoreBuffered
defer: NO];
[window setBackgroundColor: color];
[window setAlphaValue: 1.0];
[window setOpaque: NO];
However, popping open the window, all I got was a _black_ background on
back-art and a _white_ background on back-xlib.
Looking at the source to NSColor, I saw that +clearColor really is just
a [self colorWithCalibratedWhite: 0.0 alpha: 0.0]
Playing around with various color settings I found out that both,
+colorWithCalibratedWhite:alpha: and +colorWithDeviceWhite:alpha: do
exactly the same thing: black on back-art, white on back-xlib, without
any regard of the values passed for 'white' or 'alpha'.
Using +setIgnoresAlpha: didn't seem to make a difference either.
All the +<color>Color and +colorWith<whatever>:a:b:c: seem to work fine.
Is this a known problem, or am I missing something?
--
Chris
- NSColor question,
Chris B. Vetter <=