Class RgbUtil


  • public final class RgbUtil
    extends Object
    This is an utility class that provides method for converting from/to different color notations.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static org.eclipse.swt.graphics.RGB DEFAULT_RGB  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static org.eclipse.swt.graphics.RGB createRGB​(Integer rgb)
      A copy-paste of FigureUtilities.integerToRGB(java.lang.Integer)
      static org.eclipse.swt.graphics.RGB createRGB​(org.eclipse.swt.graphics.Color color)
      Creates an RGB object out of the given Color object
      static org.eclipse.swt.graphics.Color createSwtColor​(org.eclipse.swt.widgets.Widget widget, Integer rgb)
      Creates a new Color object with RGB properties specified by rgb.
      static org.eclipse.swt.graphics.Color createSwtColor​(org.eclipse.swt.widgets.Widget widget, org.eclipse.swt.graphics.RGB rgb)
      Creates a new Color object with the specified RGB properties.
      static Integer RGBToInteger​(org.eclipse.swt.graphics.RGB rgb)
      A copy-paste of FigureUtilities.RGBToInteger(org.eclipse.swt.graphics.RGB)
    • Field Detail

      • DEFAULT_RGB

        public static final org.eclipse.swt.graphics.RGB DEFAULT_RGB
    • Method Detail

      • createRGB

        public static org.eclipse.swt.graphics.RGB createRGB​(org.eclipse.swt.graphics.Color color)
        Creates an RGB object out of the given Color object
        Parameters:
        color - a Color object to take color value from
      • createRGB

        public static org.eclipse.swt.graphics.RGB createRGB​(Integer rgb)
        A copy-paste of FigureUtilities.integerToRGB(java.lang.Integer)
      • RGBToInteger

        public static Integer RGBToInteger​(org.eclipse.swt.graphics.RGB rgb)
        A copy-paste of FigureUtilities.RGBToInteger(org.eclipse.swt.graphics.RGB)
      • createSwtColor

        public static final org.eclipse.swt.graphics.Color createSwtColor​(org.eclipse.swt.widgets.Widget widget,
                                                                          org.eclipse.swt.graphics.RGB rgb)
        Creates a new Color object with the specified RGB properties. The result must be disposed of.
        Parameters:
        widget - the widget that is going to use the color
        rgb - RGB notation of the color to create
        Returns:
        Color instance; it must be disposed by the client
      • createSwtColor

        public static final org.eclipse.swt.graphics.Color createSwtColor​(org.eclipse.swt.widgets.Widget widget,
                                                                          Integer rgb)
        Creates a new Color object with RGB properties specified by rgb. The result must be disposed of.
        Parameters:
        widget - the widget that is going to use the color
        rgb - RGB notation of the color to create
        Returns:
        Color instance; it must be disposed by the client