Search in sources :

Example 1 with IThemeRegistry

use of org.eclipse.ui.internal.themes.IThemeRegistry in project archi by archimatetool.

the class PaletteColorUtil method getThemeColor.

/**
 * Added by Phillipus - get a theme color from the theme registry
 */
private static Color getThemeColor(final String id, RGB defaultColor) {
    IThemeRegistry reg = WorkbenchPlugin.getDefault().getThemeRegistry();
    ColorDefinition colorDef = reg.findColor(id);
    if (colorDef != null && colorDef.getValue() != null) {
        defaultColor = colorDef.getValue();
    }
    return new Color(defaultColor);
}
Also used : IThemeRegistry(org.eclipse.ui.internal.themes.IThemeRegistry) ColorDefinition(org.eclipse.ui.internal.themes.ColorDefinition) Color(org.eclipse.swt.graphics.Color)

Aggregations

Color (org.eclipse.swt.graphics.Color)1 ColorDefinition (org.eclipse.ui.internal.themes.ColorDefinition)1 IThemeRegistry (org.eclipse.ui.internal.themes.IThemeRegistry)1