Class RgbaColor

  • All Implemented Interfaces:
    Color

    public class RgbaColor
    extends java.lang.Object
    implements Color
    • Constructor Detail

      • RgbaColor

        public RgbaColor​(int red,
                         int green,
                         int blue)
      • RgbaColor

        public RgbaColor​(int red,
                         int green,
                         int blue,
                         float alpha)
    • Method Detail

      • withAlpha

        public RgbaColor withAlpha​(float alpha)
      • toHtmlColorString

        public java.lang.String toHtmlColorString()
        Specified by:
        toHtmlColorString in interface Color
      • getRed

        public int getRed()
      • getGreen

        public int getGreen()
      • getBlue

        public int getBlue()
      • getHue

        public float getHue()
      • getSaturation

        public float getSaturation()
      • getLuminance

        public float getLuminance()
      • getAlpha

        public float getAlpha()
      • withBrightness

        public RgbaColor withBrightness​(float brightnessZeroToOne)
      • withLuminance

        public RgbaColor withLuminance​(float luminanceZeroToOne)
      • rgbToHsl

        public static float[] rgbToHsl​(int red,
                                       int green,
                                       int blue)
      • fromHsla

        public static RgbaColor fromHsla​(float h,
                                         float s,
                                         float l,
                                         float alpha)
        Parameters:
        h - 0-1
        s - 0-1
        l - 0-1
        alpha - 0-1
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • fromAwtColor

        public static RgbaColor fromAwtColor​(java.awt.Color color)
      • fromAwtColor

        public static RgbaColor fromAwtColor​(java.awt.Color color,
                                             float alpha)
      • fromHsba

        public static RgbaColor fromHsba​(float h,
                                         float s,
                                         float b,
                                         float alpha)
      • fromRgb

        public static RgbaColor fromRgb​(int red,
                                        int green,
                                        int blue)
      • fromRgba

        public static RgbaColor fromRgba​(int red,
                                         int green,
                                         int blue,
                                         float alpha)
      • fromRgbValue

        public static RgbaColor fromRgbValue​(int rgb)
      • fromRgbaValue

        public static RgbaColor fromRgbaValue​(int rgba)
      • fromHex

        public static RgbaColor fromHex​(java.lang.String hex)
      • fromHtmlString

        public static RgbaColor fromHtmlString​(java.lang.String value)