Class ResourceColor

  • All Implemented Interfaces:
    Color

    public class ResourceColor
    extends java.lang.Object
    implements Color
    A color that retrieves its values from the Guise session resources based upon a resource key. When color-related access methods are called the calling thread must have access to the current Guise session.
    Author:
    Garret Wilson
    See Also:
    GuiseSession.getColorResource(String)
    • Constructor Detail

      • ResourceColor

        public ResourceColor​(java.lang.String resourceKey)
        Resource key constructor.
        Parameters:
        resourceKey - The key to accessing the color defined in the resources.
        Throws:
        java.lang.NullPointerException - if the given resource key is null.
    • Method Detail

      • getResourceKey

        public java.lang.String getResourceKey()
        Returns:
        The key to accessing the color defined in the resources.
      • asHSL

        public HSLColor asHSL()

        This implementation retrieves a color from the Guise session resources and delegates to that object.

        Specified by:
        asHSL in interface Color
        Returns:
        The color in the HSL color space.
      • asRGB

        public RGBColor asRGB()

        This implementation retrieves a color from the Guise session resources and delegates to that object.

        Specified by:
        asRGB in interface Color
        Returns:
        The color in the RGB color space.
      • hashCode

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

        public boolean equals​(java.lang.Object object)

        This implementation returns whether the object is another resource color with the same resource key.

        Overrides:
        equals in class java.lang.Object
        See Also:
        getResourceKey()