Class Color

java.lang.Object
com.jozufozu.flywheel.util.Color

public class Color extends Object
  • Field Details

    • TRANSPARENT_BLACK

      public static final Color TRANSPARENT_BLACK
    • BLACK

      public static final Color BLACK
    • WHITE

      public static final Color WHITE
    • RED

      public static final Color RED
    • GREEN

      public static final Color GREEN
    • SPRING_GREEN

      public static final Color SPRING_GREEN
    • mutable

      protected boolean mutable
    • value

      protected int value
  • Constructor Details

    • Color

      public Color(int r, int g, int b)
    • Color

      public Color(int r, int g, int b, int a)
    • Color

      public Color(float r, float g, float b, float a)
    • Color

      public Color(int rgba)
    • Color

      public Color(int rgb, boolean hasAlpha)
  • Method Details

    • copy

      public Color copy()
    • copy

      public Color copy(boolean mutable)
    • setImmutable

      public Color setImmutable()
      Mark this color as immutable. Attempting to mutate this color in the future will instead cause a copy to be created that can me modified.
    • getRed

      public int getRed()
      Returns:
      the red component in the range 0-255.
      See Also:
    • getGreen

      public int getGreen()
      Returns:
      the green component in the range 0-255.
      See Also:
    • getBlue

      public int getBlue()
      Returns:
      the blue component in the range 0-255.
      See Also:
    • getAlpha

      public int getAlpha()
      Returns:
      the alpha component in the range 0-255.
      See Also:
    • getRedAsFloat

      public float getRedAsFloat()
      Returns:
      the red component in the range 0-1f.
    • getGreenAsFloat

      public float getGreenAsFloat()
      Returns:
      the green component in the range 0-1f.
    • getBlueAsFloat

      public float getBlueAsFloat()
      Returns:
      the blue component in the range 0-1f.
    • getAlphaAsFloat

      public float getAlphaAsFloat()
      Returns:
      the alpha component in the range 0-1f.
    • getRGB

      public int getRGB()
      Returns the RGB value representing this color (Bits 24-31 are alpha, 16-23 are red, 8-15 are green, 0-7 are blue).
      Returns:
      the RGB value of the color
    • asVector

      public net.minecraft.world.phys.Vec3 asVector()
    • asVectorF

      public com.mojang.math.Vector3f asVectorF()
    • setRed

      public Color setRed(int r)
    • setGreen

      public Color setGreen(int g)
    • setBlue

      public Color setBlue(int b)
    • setAlpha

      public Color setAlpha(int a)
    • setRed

      public Color setRed(float r)
    • setGreen

      public Color setGreen(float g)
    • setBlue

      public Color setBlue(float b)
    • setAlpha

      public Color setAlpha(float a)
    • scaleAlpha

      public Color scaleAlpha(float factor)
    • mixWith

      public Color mixWith(Color other, float weight)
    • darker

      public Color darker()
    • brighter

      public Color brighter()
    • setValue

      public Color setValue(int value)
    • modifyValue

      public Color modifyValue(UnaryOperator<Integer> function)
    • ensureMutable

      protected Color ensureMutable()
    • setRedUnchecked

      protected Color setRedUnchecked(int r)
    • setGreenUnchecked

      protected Color setGreenUnchecked(int g)
    • setBlueUnchecked

      protected Color setBlueUnchecked(int b)
    • setAlphaUnchecked

      protected Color setAlphaUnchecked(int a)
    • setValueUnchecked

      protected Color setValueUnchecked(int value)
    • mixColors

      public static Color mixColors(@Nonnull Color c1, @Nonnull Color c2, float w)
    • mixColors

      public static int mixColors(int color1, int color2, float w)
    • rainbowColor

      public static Color rainbowColor(int timeStep)
    • generateFromLong

      public static Color generateFromLong(long l)