canvas (package)
import "fyne.io/fyne/v2/canvas"Package canvas contains all of the primitive CanvasObjects that make up a Fyne GUI.
The types implemented in this package are used as building blocks in order to build higher order functionality. These types are designed to be non-interactive, by design. If additional functionality is required, it’s usually a sign that this type should be used as part of a custom widget.
Usage
const (
	// DurationStandard is the time a standard interface animation will run.
	//
	// Since: 2.0
	DurationStandard = time.Millisecond * 300
	// DurationShort is the time a subtle or small transition should use.
	//
	// Since: 2.0
	DurationShort = time.Millisecond * 150
)const (
	// RadiusMaximum can be applied to a canvas corner radius to achieve fully rounded corners.
	// This constant represents the maximum possible corner radius, resulting in a circular appearance.
	// Since: 2.7
	RadiusMaximum float32 = math.MaxFloat32
)func NewColorRGBAAnimation
func NewColorRGBAAnimation(start, stop color.Color, d time.Duration, fn func(color.Color)) *fyne.AnimationNewColorRGBAAnimation sets up a new animation that will transition from the start to stop Color over the specified Duration. The colour transition will move linearly through the RGB colour space. The content of fn should apply the color values to an object and refresh it. You should call Start() on the returned animation to start it.
2.0func NewPositionAnimation
func NewPositionAnimation(start, stop fyne.Position, d time.Duration, fn func(fyne.Position)) *fyne.AnimationNewPositionAnimation sets up a new animation that will transition from the start to stop Position over the specified Duration. The content of fn should apply the position value to an object for the change to be visible. You should call Start() on the returned animation to start it.
2.0func NewSizeAnimation
func NewSizeAnimation(start, stop fyne.Size, d time.Duration, fn func(fyne.Size)) *fyne.AnimationNewSizeAnimation sets up a new animation that will transition from the start to stop Size over the specified Duration. The content of fn should apply the size value to an object for the change to be visible. You should call Start() on the returned animation to start it.
2.0func RecolorSVG
func RecolorSVG(svgContent []byte, color color.Color) ([]byte, error)RecolorSVG takes a []byte containing SVG content, and returns new SVG content, re-colorized to be monochrome with the given color. The content can be assigned to a new fyne.StaticResource with an appropriate name to be used in a widget.Button, canvas.Image, etc.
If an error occurs, the returned content will be the original un-modified content, and a non-nil error is returned.
2.6func Refresh
func Refresh(obj fyne.CanvasObject)Refresh instructs the containing canvas to refresh the specified obj.