Class ColorUtils

Object
ColorUtils

public class ColorUtils extends Object
Contains methods for working with OpenGL and AWT color objects.
Since:
1.9
Author:
LazyWizard
  • Method Details

    • glColor

      public static void glColor(Color color, float alphaMult, boolean overrideOriginalAlpha)
      Sets the OpenGL color using an AWT Color object.
      Parameters:
      color - The color to set.
      alphaMult - Multiplies the color's alpha channel with this, or replaces it if overrideOriginalAlpha is true.
      overrideOriginalAlpha - Whether to completely override color's alpha channel with alphaMult.
      Since:
      1.9
    • glColor

      public static void glColor(Color color, float alpha)
      Sets the OpenGL color using an AWT Color object.
      Parameters:
      color - The color to set.
      alpha - The color's opacity, from 0 to 1.
      Since:
      2.3
    • glColor

      public static void glColor(Color color)
      Sets the OpenGL color using an AWT Color object.
      Parameters:
      color - The color to set.
      Since:
      1.9
    • genRandomColor

      public static Color genRandomColor()
      Generates a Color with randomized RGB components.
      Returns:
      A Color whose RGB components are all randomized. Alpha will be at 100%.
      Since:
      3.0