Package snap.gfx

Interface Paint

All Superinterfaces:
StringCodec.Codeable, XMLArchiver.Archivable
All Known Implementing Classes:
Color, GradientPaint, ImagePaint

public interface Paint extends XMLArchiver.Archivable, StringCodec.Codeable
A class to represent a fill for a Shape or text (Color, GradientPaint, ImagePaint).
  • Method Summary

    Modifier and Type
    Method
    Description
    default String
    Returns Paint as string.
    Returns a copy of this paint modified for given color.
    Returns an absolute paint for given bounds of primitive to be filled.
    default Paint
    Returns Paint for string.
    Returns the closest color approximation of this paint.
    default String
    Returns the name for paint.
    boolean
    Returns whether paint is defined in terms independent of primitive to be filled.
    boolean
    Returns whether paint is opaque.
    static Paint
    of(Object anObj)
    Returns a color from given object.

    Methods inherited from interface snap.util.XMLArchiver.Archivable

    fromXML, toXML
  • Method Details

    • isAbsolute

      boolean isAbsolute()
      Returns whether paint is defined in terms independent of primitive to be filled.
    • isOpaque

      boolean isOpaque()
      Returns whether paint is opaque.
    • copyForRect

      Paint copyForRect(Rect aRect)
      Returns an absolute paint for given bounds of primitive to be filled.
    • getName

      default String getName()
      Returns the name for paint.
    • getColor

      Color getColor()
      Returns the closest color approximation of this paint.
    • copyForColor

      Paint copyForColor(Color aColor)
      Returns a copy of this paint modified for given color.
    • codeString

      default String codeString()
      Returns Paint as string.
      Specified by:
      codeString in interface StringCodec.Codeable
    • decodeString

      default Paint decodeString(String aString)
      Returns Paint for string.
      Specified by:
      decodeString in interface StringCodec.Codeable
    • of

      static Paint of(Object anObj)
      Returns a color from given object.