pixie/paints

Types

PaintKind = enum
  pkSolid, pkImage, pkImageTiled, pkGradientLinear, pkGradientRadial,
  pkGradientAngular
  Source Edit
Paint = ref object
  kind*: PaintKind
  blendMode*: BlendMode      ## Blend mode.
  opacity*: float32
  color*: Color              ## Color to fill with.
  image*: Image              ## Image to fill with.
  imageMat*: Mat3            ## Matrix of the filled image.
  gradientHandlePositions*: seq[Vec2] ## Gradient positions (image space).
  gradientStops*: seq[ColorStop] ## Color stops (gradient space).
  
Paint used to fill paths.   Source Edit
ColorStop = object
  color*: Color              ## Color of the stop.
  position*: float32         ## Gradient stop position 0..1.
  
Color stop on a gradient curve.   Source Edit
SomePaint = string | Paint | SomeColor
  Source Edit

Procs

proc newPaint(kind: PaintKind): Paint {...}{.raises: [], tags: [].}
Create a new Paint.   Source Edit
proc newPaint(paint: Paint): Paint {...}{.raises: [], tags: [].}
Create a new Paint with the same properties.   Source Edit
proc colorStop(color: Color; position: float32): ColorStop {...}{.raises: [],
    tags: [].}
  Source Edit
proc fillGradient(image: Image; paint: Paint) {...}{.raises: [PixieError], tags: [].}
Fills with the Paint gradient.   Source Edit

Converters

converter parseSomePaint(paint: SomePaint): Paint {...}{.inline.}
Given SomePaint, parse it in different ways.   Source Edit