com.dlsc.flexgantt.swing.util

## Class ColorUtil

- java.lang.Object
- - com.dlsc.flexgantt.swing.util.ColorUtil

-     public class ColorUtil
      extends Object

  A utility class for dealing with instances of `Color`.
  Since:
    1.0
  Version:
    $Revision: 1.8 $
  Author:
    Dirk Lemmermann

- - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static int` | `getDefaultAlpha()` Returns the default alpha value used for making colors transparent.
    `static Color` | `getFocusBackground()` Returns the default focus background color.
    `static Color` | `getFocusBorderColor()` Returns the color used for drawing the focus border (e.g. in `SpreadsheetLayer`).
    `static Color` | `getFocusForeground()` Returns the default focus foreground color.
    `static Color` | `getGridColor()` Returns the default grid color.
    `static Color` | `getSelectionBackground()` Returns the default selection background color.
    `static Color` | `getSelectionForeground()` Returns the default selection foreground color.
    `static Color` | `makeTransparent(Color color)` Converts the given color into a transparent color with the same red, green, blue values.
    `static Color` | `makeTransparent(Color color, int alpha)` Converts the given color into a transparent color with the same red, green, blue values.
    `static void` | `setDefaultAlpha(int alpha)` Sets the default alpha value used for making colors transparent.
    `static void` | `setFocusBackground(Color color)` Sets the default focus background color.
    `static void` | `setFocusBorderColor(Color color)` Sets the color used for drawing the focus border (e.g. in `SpreadsheetLayer`).
    `static void` | `setFocusForeground(Color color)` Sets the default focus foreground color.
    `static void` | `setGridColor(Color color)` Sets the default grid color.
    `static void` | `setSelectionBackground(Color color)` Sets the default selection background color.
    `static void` | `setSelectionForeground(Color color)` Sets the default selection foreground color.

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

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

- - ### Method Detail

    - #### makeTransparent

          public static Color makeTransparent(Color color)

      Converts the given color into a transparent color with the same red, green, blue values. This method delegates to the method `makeTransparent(Color, int)` and uses the default alpha value.
      Parameters:
        `color` - the now transparent copy of the passed in color
      Returns:
        the now transparent color
      Since:
        1.0
      See Also:
        `setDefaultAlpha(int)`

    - #### makeTransparent

          public static Color makeTransparent(Color color,
                                              int alpha)

      Converts the given color into a transparent color with the same red, green, blue values.
      Parameters:
        `color` - the now transparent copy of the passed in color
        `alpha` - the alpha value that will be used for the new color
      Returns:
        the now transparent copy of the passed in color
      Since:
        1.0

    - #### getDefaultAlpha

          public static int getDefaultAlpha()

      Returns the default alpha value used for making colors transparent.
      Returns:
        the default alpha value ([0, 255])
      Since:
        1.0
      See Also:
        `makeTransparent(Color)`

    - #### setDefaultAlpha

          public static void setDefaultAlpha(int alpha)

      Sets the default alpha value used for making colors transparent.
      Parameters:
        `alpha` - the default alpha value ([0, 255])
      Since:
        1.0
      See Also:
        `makeTransparent(Color)`

    - #### getFocusForeground

          public static Color getFocusForeground()

      Returns the default focus foreground color.
      Returns:
        the default focus foreground color
      Since:
        1.1

    - #### setFocusForeground

          public static void setFocusForeground(Color color)

      Sets the default focus foreground color.
      Parameters:
        `color` - the new focus foreground color
      Since:
        1.1

    - #### getFocusBackground

          public static Color getFocusBackground()

      Returns the default focus background color.
      Returns:
        the default focus background color
      Since:
        1.1

    - #### setFocusBackground

          public static void setFocusBackground(Color color)

      Sets the default focus background color.
      Parameters:
        `color` - the new focus background color
      Since:
        1.1

    - #### getSelectionForeground

          public static Color getSelectionForeground()

      Returns the default selection foreground color.
      Returns:
        the default selection foreground color
      Since:
        1.1

    - #### setSelectionForeground

          public static void setSelectionForeground(Color color)

      Sets the default selection foreground color.
      Parameters:
        `color` - the new selection foreground color
      Since:
        1.1

    - #### getSelectionBackground

          public static Color getSelectionBackground()

      Returns the default selection background color.
      Returns:
        the default selection background color
      Since:
        1.1

    - #### setSelectionBackground

          public static void setSelectionBackground(Color color)

      Sets the default selection background color.
      Parameters:
        `color` - the new selection background color
      Since:
        1.1

    - #### getGridColor

          public static Color getGridColor()

      Returns the default grid color.
      Returns:
        the default grid color
      Since:
        1.1

    - #### setGridColor

          public static void setGridColor(Color color)

      Sets the default grid color.
      Parameters:
        `color` - the new grid color
      Since:
        1.1

    - #### getFocusBorderColor

          public static Color getFocusBorderColor()

      Returns the color used for drawing the focus border (e.g. in `SpreadsheetLayer`).
      Returns:
        the focus border color
      Since:
        2.1

    - #### setFocusBorderColor

          public static void setFocusBorderColor(Color color)

      Sets the color used for drawing the focus border (e.g. in `SpreadsheetLayer`).
      Parameters:
        `color` - the color to use for drawing the border
      Since:
        2.1

Copyright © 2006–2020 Dirk Lemmermann Software & Consulting. All rights reserved.