Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 499105

Summary: Provide a palette with logical/system colors
Product: [Modeling] Sirius Reporter: Pierre-Charles David <pierre-charles.david>
Component: CoreAssignee: Project inbox <sirius.core-inbox>
Status: RESOLVED WONTFIX QA Contact:
Severity: enhancement    
Priority: P3 CC: maxime.porhel
Version: unspecifiedKeywords: triaged
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
Example of a Sirius representation using a dark theme none

Description Pierre-Charles David CLA 2016-08-03 09:53:10 EDT
Sirius provides a standard palette with a few hard-coded colors, and allows the creation of custom palette (that can then be referenced from dialects). However in some cases (especially tables, trees and properties views), choosing hard-coded colors can produce sub-optimal or even unreadable results depending on the OS/theme/Eclipse configuration.

For example setting a tree item with an explicit black foreground color (the default) will be invisible unless selected when using a dark theme (see attached screenshot).

We could provide a new (optional) palette, or extend the default one, with "logical" colors corresponding to SWT.COLOR_WIDGET_FOREGROUND and other similar constants, or even to the ones available in the Eclipse preferences under General Appearance > Colors & Fonts. We would only store the logical value of the color, and the mapping to a concrete RGB color would happen at runtime to match the current system & preferences settings.
Comment 1 Pierre-Charles David CLA 2016-08-03 09:55:04 EDT
Created attachment 263441 [details]
Example of a Sirius representation using a dark theme

On the left of the screenshot is the standard Ecore editor, which correctly uses a white foreground to render the item's labels. On the right is the equivalent Sirius tree, which is hard-coded to use black. Most items are completely invisible except for the one currently selected.