Class ColorHelper


  • public class ColorHelper
    extends java.lang.Object
    Color utilities.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static int getBlue​(int color)
      Gets a color blue component.
      static int getColor​(int red, int green, int blue)
      Gets the color from red, green and blue components.
      static int getGreen​(int color)
      Gets a color green component.
      static int getRed​(int color)
      Gets a color red component.
      static int updateComponent​(int component, int increment)
      Update a color component by incrementing it.
      • Methods inherited from class java.lang.Object

        clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getRed

        public static int getRed​(int color)
        Gets a color red component.
        Parameters:
        color - the color.
        Returns:
        the red component.
      • getGreen

        public static int getGreen​(int color)
        Gets a color green component.
        Parameters:
        color - the color.
        Returns:
        the green component.
      • getBlue

        public static int getBlue​(int color)
        Gets a color blue component.
        Parameters:
        color - the color.
        Returns:
        the blue component.
      • getColor

        public static int getColor​(int red,
                                   int green,
                                   int blue)
        Gets the color from red, green and blue components.
        Parameters:
        red - the red component.
        green - the green component.
        blue - the blue component.
        Returns:
        the color.
      • updateComponent

        public static int updateComponent​(int component,
                                          int increment)
        Update a color component by incrementing it.

        The resulting value is bounded to a component limits.

        Parameters:
        component - the initial component value.
        increment - the increment to apply.
        Returns:
        the incremented component.