pixie/paints

  Source   Edit

Types

ColorStop = object
  color*: Color              ## Color of the stop.
  position*: float32         ## Gradient stop position 0..1.
  
Color stop on a gradient curve.   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
PaintKind = enum
  SolidPaint, ImagePaint, TiledImagePaint, LinearGradientPaint,
  RadialGradientPaint, AngularGradientPaint
  Source   Edit
SomePaint = string | Paint | SomeColor
  Source   Edit

Procs

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
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

Converters

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