Class Colors

java.lang.Object
com.botwithus.bot.api.draw.Colors

public final class Colors extends Object
Packed 0xAARRGGBB colours for debug drawing, and the two helpers for building one.

Every named constant is fully opaque. Blend by passing an explicit alpha through withAlpha(int, int) or argb(int, int, int, int) — a colour with a zero alpha draws nothing, which looks exactly like a broken overlay.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
     
    static final int
     
    static final int
     
    static final int
    The producer's own default when a command omits color.
    static final int
     
    static final int
     
    static final int
    Fully opaque alpha, as it appears in the top byte of an ARGB value.
    static final int
     
    static final int
     
    static final int
     
    static final int
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static int
    alphaOf(int argb)
    The 0..255 alpha channel of a packed colour.
    static int
    argb(int alpha, int red, int green, int blue)
    Pack four 0..255 channels.
    static int
    withAlpha(int argb, int alpha)
    The same colour at a different 0..255 alpha.

    Methods inherited from class Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Method Details

    • argb

      public static int argb(int alpha, int red, int green, int blue)
      Pack four 0..255 channels. Values outside that range are masked rather than rejected, so an arithmetic overflow in a caller's colour ramp cannot bleed into a neighbouring channel.
    • withAlpha

      public static int withAlpha(int argb, int alpha)
      The same colour at a different 0..255 alpha.
    • alphaOf

      public static int alphaOf(int argb)
      The 0..255 alpha channel of a packed colour.