Documentation
¶
Overview ¶
package render provides several routines for drawing simple shapes and gradients. It also makes an attempt at unifying colors with the Color type.
Index ¶
- Constants
- Variables
- type Color
- func (c *Color) ColorSet(clr int)
- func (c *Color) GradientSet(start, end int)
- func (c Color) ImageColor() color.RGBA
- func (c Color) Int() int
- func (c Color) IsGradient() bool
- func (c Color) RGB() (r, g, b int)
- func (c Color) RGB8() (r, g, b uint8)
- func (c Color) Steps(size int) []color.RGBA
- func (c Color) String() string
- func (c Color) Uint32() uint32
- type Image
Constants ¶
const ( BorderTop = 1 << iota BorderRight BorderBottom BorderLeft )
const ( GradientHorz = iota GradientVert )
const ( GradientRegular = iota GradientReverse )
const ( DiagTopLeft = iota DiagTopRight DiagBottomLeft DiagBottomRight )
Variables ¶
var NoColor = Color{}
Functions ¶
This section is empty.
Types ¶
type Color ¶
type Color struct {
// contains filtered or unexported fields
}
func NewGradient ¶
func NewImageColor ¶
func NewImageGradient ¶
func (*Color) GradientSet ¶
func (Color) ImageColor ¶
func (Color) IsGradient ¶
IsGradient returns whether the theme color is a gradient or not. Basically, a themeColor can either be a regular color (like an int) or a gradient when both 'start' and 'end' have valid color values.
func (Color) Steps ¶
steps returns a slice of colors corresponding to the gradient of colors from start to end. The size is determined by the 'size' parameter. The first and last colors in the slice are guaranteed to be c.start and c.end. (Unless the size is 1, in which case, the first and only color in the slice is c.start.) XXX: Optimize.
type Image ¶
func (*Image) GradientFunc ¶
XXX: Optimize.
func (*Image) ThinBorder ¶
XXX: Optimize.