Interface RGBAColor

All Superinterfaces:
Color, Simplifiable
All Known Implementing Classes:
RGBAColorDoubleImpl, RGBAColorIntImpl

public interface RGBAColor extends Simplifiable, Color
Represents a Color as RGBA.
R = red, G = green, B = blue, A = alpha / transparency.
  • Field Details

  • Method Details

    • getRed

      int getRed()
      Red value of this color as int. Always between 0 (no red) and 255 (max red).
      Returns:
      red value of this color
    • getGreen

      int getGreen()
      Green value of this color as int. Always between 0 (no green) and 255 (max green).
      Returns:
      green value of this color
    • getBlue

      int getBlue()
      Blue value of this color as int. Always between 0 (no blue) and 255 (max blue).
      Returns:
      blue value of this color
    • getAlpha

      int getAlpha()
      Alpha value of this color as int. Always between 0 (fully transparent) and 255 (opaque).
      Returns:
      alpha value of this color
    • red

      double red()
      Red value of this color as double. Always between 0.0 (no red) and 1.0 (max red).
      Returns:
      red value of this color
    • green

      double green()
      Green value of this color as double. Always between 0.0 (no green) and 1.0 (max green).
      Returns:
      green value of this color
    • blue

      double blue()
      Blue value of this color as double. Always between 0.0 (no blue) and 1.0 (max blue).
      Returns:
      blue value of this color
    • alpha

      double alpha()
      Alpha value of this color as double. Always between 0.0 (fully transparent) and 1.0 (opaque).
      Returns:
      alpha value of this color
    • toRGBAHex

      default int toRGBAHex()
      Returns a hex color with the format: #rrggbbaa.
      Returns:
      this color as rgba hex.
    • toRGBHex

      default int toRGBHex()
      Returns a hex color with the format: #00rrggbb.
      Returns:
      this color as rgb hex.
    • toJavaAwtColor

      @NotNull default Color toJavaAwtColor()
      Returns this color as Color. Uses the int color values for the conversion.
      Returns:
      Color representing this RGBAColor.
    • addToSgrAsForeground

      @NotNull default @NotNull SGR addToSgrAsForeground(@NotNull @NotNull SGR sgr)
    • addToSgrAsBackground

      @NotNull default @NotNull SGR addToSgrAsBackground(@NotNull @NotNull SGR sgr)
    • simplify

      @NotNull default @NotNull Integer simplify()
      Specified by:
      simplify in interface Simplifiable
      Returns:
      must return Byte, Short, Integer, Long, Float, Double, Boolean or something that the method, that accepts a Simplifiable specifies.
    • toRGBAColor

      @NotNull default @NotNull RGBAColor toRGBAColor()
      Description copied from interface: Color
      This Color converted to RGBAColor. If this is already a RGBAColor, this object itself may be returned.
      Specified by:
      toRGBAColor in interface Color
      Returns:
      RGBAColor
    • toHSVAColor

      @NotNull default @NotNull HSVAColor toHSVAColor()
      Description copied from interface: Color
      This Color converted to HSVAColor. If this is already a HSVAColor, this object itself may be returned.
      Specified by:
      toHSVAColor in interface Color
      Returns:
      HSVAColor