Bug 180415 - Implement "Kelvin Colours"
Summary: Implement "Kelvin Colours"
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.3   Edit
Hardware: PC All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Kevin McGuire CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-04-01 23:34 EDT by Kevin McGuire CLA
Modified: 2007-05-07 10:48 EDT (History)
3 users (show)

See Also:


Attachments
Kelvin's mockup for the color rules (24.32 KB, image/gif)
2007-04-01 23:41 EDT, Kevin McGuire CLA
no flags Details
Initial patch implementing Kelvin's rules (8.80 KB, patch)
2007-04-01 23:45 EDT, Kevin McGuire CLA
no flags Details | Diff
Results comparing Kelvin's mockup to actual XP schemes (141.44 KB, image/jpeg)
2007-04-01 23:52 EDT, Kevin McGuire CLA
no flags Details
Complete patch for Kelvin colours (10.28 KB, patch)
2007-04-05 15:36 EDT, Kevin McGuire CLA
no flags Details | Diff
Patch with some slight cleanup (14.20 KB, patch)
2007-04-05 22:33 EDT, Kevin McGuire CLA
no flags Details | Diff
GTK verification (29.89 KB, image/pjpeg)
2007-05-04 22:12 EDT, Kelvin Chan CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kevin McGuire CLA 2007-04-01 23:34:08 EDT
Implement the following color selection scheme for selected active tab begin/end as follows:

Group 1
Rule: If at least 2 of the RGB values for TITLE_BACKGROUND_GRADIENT are equal to or between 181 and 255, then apply specified opacity for Group 1
Examples:  Vista, XP Silver

Gradient Top = Base colour + 75% white
Gradient Bottom/Base colour = TITLE_BACKGROUND

Group 2
Rule: If atleast 2 of the RGB values are equal to or between 100 and 180, then apply specified opacity for Group 2
Examples:  XP Olive, OS X Graphite , GTK

Gradient Top = Base colour + 75% white
Gradient Bottom/Base colour = TITLE_BACKGROUND + 30% white

Group 3
Rule: If atleast 2 of the RGB values are equal to or between 0 and 99, then apply specified opacity for Group 3
Examples:  XP Blue, Wn Classic, Wn Plum, Wn Marine

Gradient Top = Base colour + 75% white
Gradient Bottom/Base colour = TITLE_BACKGROUND + 60% white

Group 4
Rule: If each of the 3 RGB values are between 0-99, 100-180, and 181-255, then apply specified opacity for Group 4
Examples:  OS X Blue

Gradient Top = Base colour + 75% white
Gradient Bottom/Base colour = TITLE_BACKGROUND + 30% white

Group 5 - Exceptions
Rule: No gradients are used for the High Contrast themes
Examples: XP HC, Wn HC
Comment 1 Kevin McGuire CLA 2007-04-01 23:41:34 EDT
Created attachment 62621 [details]
Kelvin's mockup for the color rules
Comment 2 Kevin McGuire CLA 2007-04-01 23:45:11 EDT
Created attachment 62622 [details]
Initial patch implementing Kelvin's rules
Comment 3 Kevin McGuire CLA 2007-04-01 23:52:26 EDT
Created attachment 62623 [details]
Results comparing Kelvin's mockup to actual XP schemes
Comment 4 Kevin McGuire CLA 2007-04-01 23:59:30 EDT
Note to Tod: if we go this route we'll need to remove DarkColorSelectionFactory.
Comment 5 Kevin McGuire CLA 2007-04-02 18:16:26 EDT
On Vista I am getting {153, 180, 209} for TITLE_BACKGROUND, which doesn't fit Group 1 like it should, since Group 1 starts at 181.  Thus we get Group3 and it looks too  dark.

Kelvin says to adjust Group1 to 180 as bottom threshold since his colour sample was showing both 180 and 181 for Vista.
Comment 6 Kevin McGuire CLA 2007-04-02 18:23:12 EDT
Two comments:

1) This group/threshold approach seems to produce reasonable results for the default platform schemes but I am concerned that because its so threshold based that we may not get good results for all colour schemes.  Had brief IM chat with Kelvin about moving to a HSB model which might lend itself to a single formula for computing the amount of white needed to get the colour where we need.

2) I miss the white text :(
Comment 7 Kevin McGuire CLA 2007-04-05 15:36:02 EDT
Created attachment 63093 [details]
Complete patch for Kelvin colours

This patch should be evaluated for committing
Comment 8 Tod Creasey CLA 2007-04-05 16:14:10 EDT
A couple of things

We shouldn't call the class KelvinColors - I suggest renaming to workbench colors

The class comment was out of date

I get the following NPE when I start Eclipse self hosted now

at org.eclipse.swt.custom.CTabFolder.allocSelectionHighlightGradientColors(CTabFolder.java:3428)
	at org.eclipse.swt.custom.CTabFolder.setSelectionBackground(CTabFolder.java:3353)
	at org.eclipse.ui.internal.presentations.r33.PaneFolder.setSelectionBackground(PaneFolder.java:740)
	at org.eclipse.ui.internal.presentations.r33.DefaultTabFolder.updateColors(DefaultTabFolder.java:490)
	at org.eclipse.ui.internal.presentations.r33.DefaultTabFolder.shellActive(DefaultTabFolder.java:508)
	at org.eclipse.ui.internal.presentations.util.PresentablePartFolder$2.shellActivated(PresentablePartFolder.java:64)
	at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:81)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:938)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:962)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:943)
	at org.eclipse.swt.widgets.Decorations.WM_ACTIVATE(Decorations.java:1591)
	at org.eclipse.swt.widgets.Shell.WM_ACTIVATE(Shell.java:1832)
	at org.eclipse.swt.widgets.Control.windowProc(Control.java:3668)
	at org.eclipse.swt.widgets.Decorations.windowProc(Decorations.java:1554)
	at org.eclipse.swt.widgets.Shell.windowProc(Shell.java:1752)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:4342)
	at org.eclipse.swt.internal.win32.OS.BringWindowToTop(Native Method)
	at org.eclipse.swt.widgets.Decorations.bringToTop(Decorations.java:227)
	at org.eclipse.swt.widgets.Shell.open(Shell.java:1068)
	at org.eclipse.jface.window.Window.open(Window.java:792)
	at org.eclipse.ui.internal.WorkbenchWindow.open(WorkbenchWindow.java:735)
	at org.eclipse.ui.internal.Workbench$21.runWithException(Workbench.java:1037)
	at org.eclipse.ui.internal.StartupThreading$StartupRunnable.run(StartupThreading.java:31)
	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:123)
	at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3650)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3287)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2284)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2200)
	at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:466)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:289)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:461)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:101)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:152)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:106)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:76)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:359)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:174)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:615)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:476)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:416)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1141)
Comment 9 Kevin McGuire CLA 2007-04-05 17:48:07 EDT
>>We shouldn't call the class KelvinColors

I thought people would just interpret it as in "temperature" :)  And a nice recognition for Klevin.  Its not workbench colours ... all the schemes are, its one particular colour scheme, hence got stuck for name.  That said, we can rename it <sniff>.

As for the NPE, that's odd, I tested it on both XP and Vista and didn't get.  I will investigate but probably need your machine to do so.
Comment 10 Kevin McGuire CLA 2007-04-05 22:33:18 EDT
Created attachment 63137 [details]
Patch with some slight cleanup

I've update the patch with some slight cleanup and catching one possible error case of a malformed xml but that's not what's occuring.  For the failure you reported, the factory would have to leave the tab end color as null and not sure how that can happen from looking at the code.  Was there anything else in your log?  Were there other changes in the workspace that might explain how my results are different?
Comment 11 Tod Creasey CLA 2007-04-09 10:24:30 EDT
Patch released for build >20070309
Comment 12 Kevin McGuire CLA 2007-05-01 15:18:52 EDT
I've verified in I0501 against all the XP themes and Vista that we are getting what the mockup attachment 1 [details] shows.

Kelvin, can you please verify GTK?  I just checked on a GTK box that was running "blue curve" (?) which I thought was the default and I am not getting your mockup.
Comment 13 Kevin McGuire CLA 2007-05-01 17:14:15 EDT
Verified OS X
Comment 14 Kelvin Chan CLA 2007-05-04 22:12:37 EDT
Created attachment 65989 [details]
GTK verification

Looks good here in GTK.