Package org.eclipse.gef.ui.palette

# Class PaletteColorProvider

java.lang.Object
org.eclipse.gef.GEFColorProvider
org.eclipse.gef.ui.palette.PaletteColorProvider

All Implemented Interfaces:
  `org.eclipse.draw2d.ColorProvider`

public class PaletteColorProvider extends GEFColorProvider
Default colors used by the `PaletteViewer` which are used when painting the palette figures. Clients may extend this class to define their own colors. The color provider can be set via `PaletteViewer.setColorProvider(PaletteColorProvider)`. Important This class is still work-in-progress and new methods might be added in the future.

Since:
  3.20

## Nested Class Summary

## Nested classes/interfaces inherited from interface org.eclipse.draw2d.ColorProvider

`org.eclipse.draw2d.ColorProvider.SystemColorFactory`

## Field Summary

Fields
Modifier and Type
Field
Description
`static final PaletteColorProvider`
`INSTANCE`

## Constructor Summary

Constructors
Modifier
Constructor
Description
`protected`
`PaletteColorProvider()`

## Method Summary

Modifier and Type
Method
Description
`Color`
`getButton()`
`Color`
`getButtonDarker()`
`final Color`
`getButtonDarker(double weight)`
Returns the mix of `getButton()` with `getButtonDarker()` with weight `weight`.
`Color`
`getButtonDarkest()`
`final Color`
`getHotspotColor()`
Returns the foreground color of the `PinFigure` when the cursor is over the button.
`Color`
`getListBackground()`
`final Color`
`getListBackground(double weight)`
Returns the mix of `getButton()` with `getListBackground()` with weight `weight`.
`Color`
`getListForeground()`
`Color`
`getListHoverBackgroundColor()`
`Color`
`getListSelectedBackgroundColor()`

### Methods inherited from class org.eclipse.gef.GEFColorProvider

`getButtonLightest, getLineForeground, getMenuBackground, getMenuBackgroundSelected, getMenuForeground, getMenuForegroundSelected, getShadowColor, getTitleBackground, getTitleForeground, getTitleGradient, getTitleInactiveBackground, getTitleInactiveForeground, getTitleInactiveGradient, getTooltipBackground, getTooltipForeground`

### Methods inherited from class java.lang.Object

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

## Field Details

### INSTANCE

public static final PaletteColorProvider INSTANCE

## Constructor Details

### PaletteColorProvider

protected PaletteColorProvider()

## Method Details

### getListSelectedBackgroundColor

public Color getListSelectedBackgroundColor()

Specified by:
  `getListSelectedBackgroundColor` in interface `org.eclipse.draw2d.ColorProvider`
Overrides:
  `getListSelectedBackgroundColor` in class `GEFColorProvider`

### getListHoverBackgroundColor

public Color getListHoverBackgroundColor()

Specified by:
  `getListHoverBackgroundColor` in interface `org.eclipse.draw2d.ColorProvider`
Overrides:
  `getListHoverBackgroundColor` in class `GEFColorProvider`

### getButton

public Color getButton()

Specified by:
  `getButton` in interface `org.eclipse.draw2d.ColorProvider`
Overrides:
  `getButton` in class `GEFColorProvider`

### getButtonDarker

public Color getButtonDarker()

Specified by:
  `getButtonDarker` in interface `org.eclipse.draw2d.ColorProvider`
Overrides:
  `getButtonDarker` in class `GEFColorProvider`

### getButtonDarkest

public Color getButtonDarkest()

Specified by:
  `getButtonDarkest` in interface `org.eclipse.draw2d.ColorProvider`
Overrides:
  `getButtonDarkest` in class `GEFColorProvider`

### getListBackground

public Color getListBackground()

Specified by:
  `getListBackground` in interface `org.eclipse.draw2d.ColorProvider`
Overrides:
  `getListBackground` in class `GEFColorProvider`

### getListForeground

public Color getListForeground()

Specified by:
  `getListForeground` in interface `org.eclipse.draw2d.ColorProvider`
Overrides:
  `getListForeground` in class `GEFColorProvider`

### getButtonDarker

public final Color getButtonDarker(double weight)
Returns the mix of `getButton()` with `getButtonDarker()` with weight `weight`. This weight must be within the interval [0, 1]. The mixed color is only calculated once and then cached. It is therefore recommended to only call this method with constants, to avoid rounding errors due to floating point arithmetic.

Throws:
  `IllegalArgumentException` - if `weight` is outside the valid range.

### getListBackground

public final Color getListBackground(double weight)
Returns the mix of `getButton()` with `getListBackground()` with weight `weight`. This weight must be within the interval [0, 1]. The mixed color is only calculated once and then cached. It is therefore recommended to only call this method with constants, to avoid rounding errors due to floating point arithmetic.

Throws:
  `IllegalArgumentException` - if `weight` is outside the valid range.
Since:
  3.21

### getHotspotColor

public final Color getHotspotColor()
Returns the foreground color of the `PinFigure` when the cursor is over the button.