# Class CSSSWTColorHelper

java.lang.Object
org.eclipse.e4.ui.css.swt.helpers.CSSSWTColorHelper

public class CSSSWTColorHelper extends Object

## Field Summary

Fields
Modifier and Type
Field
Description
`static final String`
`COLOR_DEFINITION_MARKER`

## Constructor Summary

Constructors
Constructor
Description
`CSSSWTColorHelper()`

## Method Summary

Modifier and Type
Method
Description
`static Gradient`
`getGradient(CSSValueList list, Display display)`
`static Integer`
`getPercent(CSSPrimitiveValue value)`
`static int[]`
`getPercents(Gradient grad)`
`static RGBA`
`getRGBA(String name)`
`static RGBA`
`getRGBA(CSSPrimitiveValue value)`
`static RGBA`
`getRGBA(CSSValue value)`
`static RGBA`
`getRGBA(RGBColor color)`
`static RGBColor`
`getRGBColor(Color color)`
`static RGBColor`
`getRGBColor(RGB color)`
`static Color`
`getSWTColor(CSSValue value, Display display)`
`static Color`
`getSWTColor(RGBColor rgbColor)`
`static Color[]`
`getSWTColors(Gradient grad, Display display, CSSEngine engine)`
`static boolean`
`hasColorDefinitionAsValue(String name)`
`static boolean`
`hasColorDefinitionAsValue(CSSValue value)`
`static void`
`setBackground(Control control, Color newColor)`
Helper function to avoid setting colors unnecessarily
`static void`
`setForeground(Control control, Color newColor)`
Helper function to avoid setting colors unnecessarily
`static void`
`setSelectionBackground(CTabFolder folder, Color newColor)`
Helper function to avoid setting colors unnecessarily
`static void`
`setSelectionForeground(CTabFolder folder, Color newColor)`
Helper function to avoid setting colors unnecessarily

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### COLOR_DEFINITION_MARKER

public static final String COLOR_DEFINITION_MARKER

See Also:
  - Constant Field Values

## Constructor Details

### CSSSWTColorHelper

public CSSSWTColorHelper()

## Method Details

### getSWTColor

public static Color getSWTColor(RGBColor rgbColor)

### getSWTColor

public static Color getSWTColor(CSSValue value, Display display)

### hasColorDefinitionAsValue

public static boolean hasColorDefinitionAsValue(CSSValue value)

### hasColorDefinitionAsValue

public static boolean hasColorDefinitionAsValue(String name)

### getRGBA

public static RGBA getRGBA(String name)

### getRGBA

public static RGBA getRGBA(RGBColor color)

### getRGBA

public static RGBA getRGBA(CSSValue value)

### getRGBA

public static RGBA getRGBA(CSSPrimitiveValue value)

### getPercent

public static Integer getPercent(CSSPrimitiveValue value)

### getGradient

public static Gradient getGradient(CSSValueList list, Display display)

### getSWTColors

public static Color[] getSWTColors(Gradient grad, Display display, CSSEngine engine) throws Exception

Throws:
  `Exception`

### getPercents

public static int[] getPercents(Gradient grad)

### getRGBColor

public static RGBColor getRGBColor(Color color)

### getRGBColor

public static RGBColor getRGBColor(RGB color)

### setForeground

public static void setForeground(Control control, Color newColor)
Helper function to avoid setting colors unnecessarily

### setBackground

public static void setBackground(Control control, Color newColor)
Helper function to avoid setting colors unnecessarily

### setSelectionForeground

public static void setSelectionForeground(CTabFolder folder, Color newColor)
Helper function to avoid setting colors unnecessarily

### setSelectionBackground

public static void setSelectionBackground(CTabFolder folder, Color newColor)
Helper function to avoid setting colors unnecessarily