Documentation ¶
Overview ¶
Package paint provides drawing operations for 2D graphics.
The PaintOp operation fills the current clip with the current brush, taking the current transformation into account.
The current brush is set by either a ColorOp for a constant color, or ImageOp for an image, or LinearGradientOp for gradients.
All color.NRGBA values are in the sRGB color space.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ImageOp ¶
type ImageOp struct {
// contains filtered or unexported fields
}
ImageOp sets the brush to an image.
Note: the ImageOp may keep a reference to the backing image. See NewImageOp for details.
func NewImageOp ¶
NewImageOp creates an ImageOp backed by src. See github.com/cryptoconcurrency/chimera/pkg/gel/gio/io/system.FrameEvent for a description of when data referenced by operations is safe to re-use.
NewImageOp assumes the backing image is immutable, and may cache a copy of its contents in a GPU-friendly way. Create new ImageOps to ensure that changes to an image is reflected in the display of it.
type LinearGradientOp ¶
type LinearGradientOp struct { Stop1 f32.Point Color1 color.NRGBA Stop2 f32.Point Color2 color.NRGBA }
LinearGradientOp sets the brush to a gradient starting at stop1 with color1 and ending at stop2 with color2.
func (LinearGradientOp) Add ¶
func (c LinearGradientOp) Add(o *op.Ops)