Class CSSRGB

    • Constructor Detail

      • CSSRGB

        public CSSRGB​(@Nonnull
                      CSSRGB aOther)
        Copy constructor
        Parameters:
        aOther - The object to copy the data from. May not be null.
      • CSSRGB

        public CSSRGB​(int nRed,
                      int nGreen,
                      int nBlue)
        Constructor
        Parameters:
        nRed - Red part. Is fitted to a value between 0 and 255.
        nGreen - Green part. Is fitted to a value between 0 and 255.
        nBlue - Blue part. Is fitted to a value between 0 and 255.
    • Method Detail

      • getRed

        @Nonnull
        @Nonempty
        public final String getRed()
        Returns:
        red part
      • getGreen

        @Nonnull
        @Nonempty
        public final String getGreen()
        Returns:
        green part
      • getBlue

        @Nonnull
        @Nonempty
        public final String getBlue()
        Returns:
        blue part
      • getAsRGBA

        @Nonnull
        public CSSRGBA getAsRGBA​(float fOpacity)
        Convert this value to an RGBA value.
        Parameters:
        fOpacity - Opacity part. Is fitted to a value between 0 and 1.
        Returns:
        This value as RGBA value with the passed opacity. Never null.
        Since:
        3.8.3
      • getAsRGBA

        @Nonnull
        public CSSRGBA getAsRGBA​(@Nonnull @Nonempty
                                 String sOpacity)
        Convert this value to an RGBA value.
        Parameters:
        sOpacity - Opacity part. May neither be null nor empty.
        Returns:
        This value as RGBA value with the passed opacity. Never null.
        Since:
        3.8.3
      • getAsString

        @Nonnull
        @Nonempty
        public String getAsString()
        Specified by:
        getAsString in interface ICSSColor
        Returns:
        The textual representation of the color.
        Since:
        3.8.3
      • getAsCSSString

        @Nonnull
        @Nonempty
        public String getAsCSSString​(@Nonnull
                                     ICSSWriterSettings aSettings,
                                     @Nonnegative
                                     int nIndentLevel)
        Description copied from interface: ICSSWriteable
        Get the contents of this object as a serialized CSS string for writing to an output.
        Specified by:
        getAsCSSString in interface ICSSWriteable
        Parameters:
        aSettings - The settings to be used to format the output. May not be null.
        nIndentLevel - The current indentation level
        Returns:
        The content of this object as CSS string. Never null.
      • getClone

        @Nonnull
        public CSSRGB getClone()
        Specified by:
        getClone in interface com.helger.commons.lang.ICloneable<CSSRGB>
        Since:
        3.8.3
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object