Package snap.gfx

Interface Paint

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

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

    Modifier and Type
    Method
    Description
    Returns a copy of this paint modified for given color.
    Returns an absolute paint for given bounds of primitive to be filled.
    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.
    default Paint
    Returns the snap version of this fill.

    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.
    • snap

      default Paint snap()
      Returns the snap version of this fill.
    • of

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