Documentation
¶
Overview ¶
Package cursorimg provides the cached rendering of SVG cursors to images.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Cursors = map[enums.Enum]map[int]*Cursor{}
Cursors contains all of the cached rendered cursors, specified first by cursor enum and then by size.
Functions ¶
This section is empty.
Types ¶
type Cursor ¶
type Cursor struct { // The cached image of the cursor. Image image.Image // The size of the cursor. Size int // The hotspot is expressed in terms of raw cursor pixels. Hotspot image.Point }
Cursor represents a cached rendered cursor, with the image.Image of the cursor and its hotspot.
func Get ¶
Get returns the cursor object corresponding to the given cursor enum, with the given size. If it is not already cached in Cursors, it renders and caches it.
It automatically replaces literal colors in svg with appropriate scheme colors as follows:
- #fff: colors.Palette.Neutral.ToneUniform(100)
- #000: colors.Palette.Neutral.ToneUniform(0)
- #f00: colors.Scheme.Error.Base
- #0f0: colors.Scheme.Success.Base
- #ff0: colors.Scheme.Warn.Base
Click to show internal directories.
Click to hide internal directories.