misc

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HexColor added in v0.5.0

func HexColor(v interface{}) color.NRGBA

func IconButton

func IconButton(th *theme.Theme, icon *widget.Icon, button *widget.Clickable, description string) material.IconButtonStyle

func WithAlpha

func WithAlpha(c color.NRGBA, a uint8) color.NRGBA

WithAlpha returns the input color with the new alpha value.

Types

type C

type C = layout.Context

type Color added in v0.5.0

type Color struct {
	color.NRGBA
}

func NewColor added in v0.5.0

func NewColor(value interface{}) Color

construct a Color from hex string, int, or wrapping a NRGBA.

func (Color) Luminance added in v0.5.0

func (c Color) Luminance() float32

Calculate relative luminance of a RGBA color.

type D

type D = layout.Dimensions

func LayoutErrorLabel

func LayoutErrorLabel(gtx C, th *theme.Theme, err error) D

type DividerStyle

type DividerStyle struct {
	Thickness unit.Dp
	Fill      color.NRGBA
	Inset     layout.Inset
	Axis      layout.Axis
}

func Divider

func Divider(axis layout.Axis, thickness unit.Dp) *DividerStyle

func (*DividerStyle) Layout

func (d *DividerStyle) Layout(gtx layout.Context, th *theme.Theme) layout.Dimensions

type Icon

type Icon struct {
	*widget.Icon
	Color color.NRGBA
	Size  unit.Dp
}

func (Icon) Layout

func (i Icon) Layout(gtx C, th *theme.Theme) D

Jump to

Keyboard shortcuts

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