类型 Triangle

API 文档由 Go 源码生成,内容为英文。

type Triangle struct {
	Points [3]Point
	// Color is the triangle's color, or, when Shaded, that of Points[0].
	Color Color
	// Shade holds the colors of Points[1] and Points[2] when Shaded. A shaded
	// triangle varies linearly from one vertex color to the next across its face,
	// straight (not premultiplied) RGBA as SVG gradients do; a gradient is a set of
	// them. Unshaded triangles ignore Shade.
	Shade  [2]Color
	Shaded bool
	Layer  uint16
	// EdgeMask marks the triangle edges that lie on the vector shape's outer
	// boundary. Bit 0 is Points[0]→Points[1], bit 1 is Points[1]→Points[2],
	// and bit 2 is Points[2]→Points[0]. Renderers feather only these edges;
	// shared tessellation edges stay fully covered.
	EdgeMask uint8
	ClipOf   Rect
	HasClip  bool
	// RectsBefore is how many of the canvas's rectangles were painted before
	// this triangle. Rectangles and triangles live in separate lists; this is
	// what interleaves them back into paint order, so an icon drawn after a
	// highlight stays above it and one drawn before stays below. It never
	// decreases along Triangles().
	RectsBefore uint32
}

Triangle is one solid vector-mesh primitive. Paths are tessellated into triangles so native backends need no SVG parser or general geometry engine.