Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type GradientTable ¶
type GradientTable []struct { Col colorful.Color Pos float64 }
GradientTable contains the "keypoints" of the colorgradient you want to generate. The position of each keypoint has to live in the range [0,256]
func (GradientTable) GetInterpolatedColorFor ¶
func (gt GradientTable) GetInterpolatedColorFor(t float64) colorful.Color
GetInterpolatedColorFor returns a HCL-blend between the two colors around `t`. Note: It relies heavily on the fact that the gradient keypoints are sorted.
type State ¶
type State struct { Position Point Direction float64 // in degrees StepSize float64 BrushSize float64 Angle float64 // Sets the number of turns that make up a complete circle to n. (Each turn will be by 360°/n.) Color int Left float64 // 1 or -1 }
State is the turtle state
type Turtle ¶
type Turtle struct {
// contains filtered or unexported fields
}
Turtle allows drawing on a canvas
func NewTurtle ¶
NewTurtle returns a new turtle centered at pos rotate controls rotation of the entire drawing by n°. Positive values rotate counterclockwise, negative values rotate clockwise. With the default of 0, the turtle begins pointing up. For example, to start with the turtle pointing to the right, use rotate 90.