Class ResourceColor

java.lang.Object
io.guise.framework.style.ResourceColor
All Implemented Interfaces:
Color

public class ResourceColor extends 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:
  • Constructor Details

    • ResourceColor

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

    • getResourceKey

      public 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 Object
    • equals

      public boolean equals(Object object)

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

      Overrides:
      equals in class Object
      See Also: