Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Color ¶
type Color struct {
// contains filtered or unexported fields
}
Color encodes a color.NRGBA color which is widely used by Gio. It provides method to convert the non-alpha-premultiplied color to a color OP used by Gio ops.
func Hex2Color ¶
Hex2Color converts a non-alpha-premultiplied hexadecimal color string to Color. The hexadecimal color can be in RGB or RGBA format. A "#" prefix is also allowed.
Example formats: "#RRGGBB", "RRGGBBAA", "RRGGBB".
type ColorPalette ¶
type ColorPalette struct {
// Foreground provides a default text color for the editor.
Foreground Color
// Background provides a default text color for the editor.
Background Color
// Color used to highlight the selections.
SelectColor Color
// Color used to highlight the current paragraph.
LineColor Color
// Color used to paint the line number
LineNumberColor Color
// contains filtered or unexported fields
}
ColorPalette manages used color of TextPainter. Color is added and referenced by its ID(index) in the palette.
func (*ColorPalette) AddColor ¶
func (p *ColorPalette) AddColor(cl Color) int
AddColor adds a color to the palette and return its id(index).
func (*ColorPalette) GetColor ¶
func (p *ColorPalette) GetColor(id int) Color
GetColor retrieves a Color by its ID. ID can be acquired when adding the color to the palette.