gradient

package module
v0.0.0-...-ba63a50 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 28, 2013 License: BSD-3-Clause, GPL-2.0-or-later Imports: 4 Imported by: 0

README

This package is written in *[http://golang.org Go]* and provides an API for drawing linear and radial gradients. As of yet, the API is not guaranteed to be final and may be changed in non-backward compatible ways.

Documentation

Overview

Package gradient draws gradients with an api similar to that specified by SVG.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DrawLinear

func DrawLinear(dst draw.Image, x0, y0, x1, y1 float64, stops []Stop)

DrawLinear draws a linear gradient to dst. If the gradient vector (as defined by x0, y0, x1, and y1) is found to be purely horizontal or purely vertical, the appropriate optimized functions will be called.

func DrawRadial

func DrawRadial(dst draw.Image, cx, cy, r, fx, fy float64, stops []Stop)

Types

type Stop

type Stop struct {
	// X is normally in the range [0,1], but values outside the range are
	// also accepted.
	X   float64
	Col color.Color
}

Stop is a gradient control point, where Col is the colour at X.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL