Class BlendedBackgroundPainter

  • All Implemented Interfaces:
    ICellPainter

    public class BlendedBackgroundPainter
    extends TextPainter

    A cell painter that can blend multiple background colours together when more than one has been registered for a given cell.

    For example, if using the alternating row colour style, when multiple rows are selected, with a normal painter, a single selection colour is applied to all the selected cell's backgrounds.

    With this painter, the selection background colour blends with the alternating colour rather than just replacing it leaving two alternating selection colours.

    Author:
    Stefan Bolton
    • Constructor Detail

      • BlendedBackgroundPainter

        public BlendedBackgroundPainter​(org.eclipse.swt.graphics.RGB gridBackgroundColour)
    • Method Detail

      • blendBackgroundColour

        public static org.eclipse.swt.graphics.Color blendBackgroundColour​(ILayerCell cell,
                                                                           IConfigRegistry configRegistry,
                                                                           org.eclipse.swt.graphics.RGB baseColor)
        Returns a background colour for the specified cell. If multiple colours have been registered, they are all blended together.
        Parameters:
        cell - the LayerCell to get a background colour for.
        configRegistry - an IConfigRegistry .
        baseColor - Colours are not blended with this colour.
        Returns:
        A blended background colour.