Package guideme.color

Class MutableColor

java.lang.Object
guideme.color.MutableColor
All Implemented Interfaces:
ColorValue

public final class MutableColor extends Object implements ColorValue
A helper for mutating color values. The color values are stored as float components between 0 and 1.
  • Constructor Details

    • MutableColor

      public MutableColor()
      Initializes a mutable color that has 1 for all components.
    • MutableColor

      public MutableColor(float r, float g, float b)
      Initializes a color value with alpha=1.
      Parameters:
      r -
      g -
      b -
    • MutableColor

      public MutableColor(float r, float g, float b, float a)
  • Method Details

    • ofArgb32

      public static MutableColor ofArgb32(int packedColor)
    • ofBytes

      public static MutableColor ofBytes(int r, int g, int b)
    • ofBytes

      public static MutableColor ofBytes(int r, int g, int b, int a)
    • of

      public static MutableColor of(ColorValue color, LightDarkMode mode)
      Resolves a symbolic color value and copies it into a new mutable color.
    • toArgb32

      public int toArgb32()
    • toAbgr32

      public int toAbgr32()
    • red

      public float red()
    • green

      public float green()
    • blue

      public float blue()
    • alpha

      public float alpha()
    • setRed

      public MutableColor setRed(float r)
    • setGreen

      public MutableColor setGreen(float g)
    • setBlue

      public MutableColor setBlue(float b)
    • setAlpha

      public MutableColor setAlpha(float a)
    • redByte

      public int redByte()
    • greenByte

      public int greenByte()
    • blueByte

      public int blueByte()
    • alphaByte

      public int alphaByte()
    • setRedByte

      public MutableColor setRedByte(int value)
    • setGreenByte

      public MutableColor setGreenByte(int value)
    • setBlueByte

      public MutableColor setBlueByte(int value)
    • setAlphaByte

      public MutableColor setAlphaByte(int value)
    • lighter

      public MutableColor lighter(float percentage)
    • darker

      public MutableColor darker(float percentage)
    • copy

      public MutableColor copy()
    • resolve

      public int resolve(LightDarkMode lightDarkMode)
      Description copied from interface: ColorValue
      Resolve as ARGB 32-bit.
      Specified by:
      resolve in interface ColorValue