Interface GuiPaint


public interface GuiPaint
What a shape or text is filled with: a plain ARGB color, an HSB color, one of the user's client colors at some opacity, or a gradient between two of those. Changing and gradient client colors keep animating when drawn.
  • Method Details

    • argb

      static GuiPaint argb(int argb)
      Parameters:
      argb - Color with alpha in the top byte
      Returns:
      The paint
    • rgb

      static GuiPaint rgb(int rgb, float alpha)
      Parameters:
      rgb - Color without alpha
      alpha - Opacity, 0 to 1
      Returns:
      The paint
    • hsb

      static GuiPaint hsb(float hue, float saturation, float brightness, float alpha)
      An HSB color. Gradients between HSB paints blend hue, saturation and brightness instead of red, green and blue, which is what color pickers need.
      Parameters:
      hue - 0 to 1
      saturation - 0 to 1
      brightness - 0 to 1
      alpha - 0 to 1
      Returns:
      The paint
    • of

      static GuiPaint of(ClientColor color, float alpha)
      Parameters:
      color - A client color
      alpha - Opacity, 0 to 1
      Returns:
      The paint
    • of

      static GuiPaint of(ColorOption.Value value)
      Parameters:
      value - A color option's value, drawn at its fill opacity
      Returns:
      The paint
    • horizontal

      static GuiPaint horizontal(GuiPaint start, GuiPaint end)
      A gradient from start at the left edge of whatever it fills to end at the right edge. See vertical(GuiPaint, GuiPaint) for how gradients behave.
      Returns:
      The paint
    • vertical

      static GuiPaint vertical(GuiPaint start, GuiPaint end)
      A gradient from start at the top edge of whatever it fills to end at the bottom edge.
      Shapes and outlines are shaded across their own bounds; text, icons and lines use start. The ends blend in start's color space, so between HSB colors hue, saturation and brightness are blended. When either end is a client gradient color, the fill uses start alone. alpha() and argb() describe start, and withAlpha(float) gives both ends that opacity.
      Returns:
      The paint
    • alpha

      float alpha()
      Returns:
      Opacity, 0 to 1
    • withAlpha

      GuiPaint withAlpha(float alpha)
      Parameters:
      alpha - New opacity, 0 to 1
      Returns:
      A copy with this opacity
    • argb

      int argb()
      Returns:
      The color as ARGB right now. Changing colors are sampled at the current time; gradients give their first color.