Class ArtPaint

java.lang.Object
com.codename1.art.ArtPaint
Direct Known Subclasses:
GradientPaint, ImagePaint, SolidPaint

public abstract class ArtPaint extends Object
What fills a shape, a stroke or text: a color, a gradient or an image.
  • Constructor Details

    • ArtPaint

      public ArtPaint()
  • Method Details

    • getOpacity

      public float getOpacity()
      The paint's own opacity, 0 to 1.
    • setOpacity

      public void setOpacity(float opacity)

      Sets the paint's opacity.

      Parameters
      • opacity: 0 to 1
    • getBlendMode

      public BlendMode getBlendMode()
      How this paint combines with the paints listed before it on the same shape.
    • setBlendMode

      public void setBlendMode(BlendMode blendMode)

      Sets the blend mode.

      Parameters
      • blendMode: the mode
    • isEnabled

      public boolean isEnabled()
      False when the paint is kept but not drawn.
    • setEnabled

      public void setEnabled(boolean enabled)

      Turns the paint on or off.

      Parameters
      • enabled: true to draw it
    • copy

      public abstract ArtPaint copy()
      A deep copy.
    • copyBase

      protected ArtPaint copyBase(ArtPaint p)
      Copies the shared properties into p and returns it.
    • colorAt

      public abstract int colorAt(double x, double y, double[] bbox)

      The color at a point of paint space.

      Parameters
      • x: x in the space of the shape that is painted
      • y: y in that space
      • bbox: the shape's bounding box as x, y, w, h, for paints relative to it