Documentation ¶
Index ¶
- Constants
- Variables
- func Cross(a, b Vector) float64
- func Dot(a, b Vector) float64
- func ParseOpacity(s string) (*float64, error)
- func Write(w io.Writer, s *Svg)
- type Circle
- type Coordinate
- type Defs
- type Ellipse
- type FillRule
- type Gradient
- type GradientStop
- type GradientUnits
- type Group
- type Item
- type Length
- type Line
- type LineCap
- type LineJoin
- type LinearGradient
- type Node
- type Paint
- type PaintKind
- type Path
- type PathCommand
- type PathData
- func (pd *PathData) Arc(lastX, lastY, rx, ry, axisRotation float64, largeArc, sweep bool, x, y float64)
- func (pd *PathData) ArcSegment(xc, yc, th0, th1, rx, ry, axisRotation float64)
- func (p *PathData) Close()
- func (p *PathData) CurveTo(c1, c2, v Vertex)
- func (p *PathData) LineTo(v Vertex)
- func (p *PathData) MoveTo(v Vertex)
- func (pd *PathData) String() string
- type Polygon
- type Polyline
- type RGB
- type RadialGradient
- type Rect
- type Shape
- type SpreadMethod
- type Svg
- type Transform
- type Units
- type Vector
- type Vertex
- type ViewBox
- type ViewBoxValue
Constants ¶
View Source
const ( UnitNone = Units(iota) UnitEM UnitEX UnitPX UnitIN UnitCM UnitMM UnitPT UnitPC UnitPercent )
Valid unit values
View Source
const ( PaintKindNone = PaintKind(iota) PaintKindRGB PaintKindGradient )
View Source
const ( GradientUnitsUnspecified = GradientUnits(iota) GradientUnitsUserSpaceOnUse GradientUnitsObjectBoundingBox )
View Source
const ( SpreadMethodUnspecified = SpreadMethod(iota) SpreadMethodPad SpreadMethodReflect SpreadMethodRepeat )
View Source
const ( FillRuleInherit = FillRule(iota) FillRuleNonZero FillRuleEvenOdd )
View Source
const ( LineCapInherit = LineCap(iota) LineCapButt LineCapRound LineCapSquare )
View Source
const ( LineJoinInerit = LineJoin(iota) LineJoinMiter LineJoinRound LineJoinBevel )
View Source
const ( PathClose = PathCommand(iota) PathMoveTo PathLineTo PathCurveTo )
Variables ¶
View Source
var ErrEmptyValue = errors.New("empty value")
Functions ¶
func ParseOpacity ¶ added in v0.0.4
Types ¶
type Circle ¶
type Circle struct { Shape Cx Coordinate Cy Coordinate Radius Length }
type Coordinate ¶
type Coordinate = Length // alias, for convenience
type Ellipse ¶
type Ellipse struct { Shape Cx Coordinate Cy Coordinate Rx Length Ry Length }
type FillRule ¶
type FillRule int
FillRule implements SVG <fill-rule> type
func (FillRule) UnmarshalText ¶
type Gradient ¶
type Gradient struct { Units GradientUnits Stops []GradientStop GradientTransform Transform SpreadMethod SpreadMethod }
type GradientStop ¶
type GradientUnits ¶
type GradientUnits int
func (GradientUnits) String ¶
func (gu GradientUnits) String() string
func (GradientUnits) Unmarshal ¶
func (gu GradientUnits) Unmarshal(s string) error
type Length ¶
type Length string
Length corresponds to SVG <length> data type, also can hold <percentage>, "auto", etc
type Line ¶
type Line struct { Shape X1 Coordinate Y1 Coordinate X2 Coordinate Y2 Coordinate }
type LinearGradient ¶
type LinearGradient struct { Gradient X1 Coordinate Y1 Coordinate X2 Coordinate Y2 Coordinate }
type Paint ¶
func ParsePaint ¶ added in v0.0.4
type PathCommand ¶
type PathCommand uint8
type PathData ¶
type PathData struct { Commands []PathCommand Vertices []Vertex }
PathData represents a command in svg.Path D (Data) attribute
func (*PathData) ArcSegment ¶
type RadialGradient ¶
type RadialGradient struct { Gradient Cx Coordinate Cy Coordinate Radius Length Fx Coordinate Fy Coordinate }
type Rect ¶
type Rect struct { Shape X Coordinate Y Coordinate Width Length Height Length Rx Length Ry Length }
type Shape ¶
type SpreadMethod ¶
type SpreadMethod int
func (SpreadMethod) String ¶
func (sm SpreadMethod) String() string
func (SpreadMethod) Unmarshal ¶
func (sm SpreadMethod) Unmarshal(s string) error
type Svg ¶
type Svg struct { Group ViewBox ViewBox X Coordinate Y Coordinate Width Length Height Length }
Svg implements SVG <svg> element
type Transform ¶
func Concatenate ¶
func Translation ¶
func UnitTransform ¶
func UnitTransform() *Transform
type Vector ¶
func (Vector) Normalized ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.