Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultPalette = &CardPalette{
	RedSuit:    color.NRGBA{R: 0xa0, B: 0x20, A: 0xff},
	BlackSuit:  color.NRGBA{A: 0xff},
	Border:     color.NRGBA{R: 0x80, G: 0x80, B: 0x80, A: 0xff},
	Background: color.NRGBA{R: 0xf0, G: 0xf0, B: 0xf0, A: 0xff},
}

Functions

This section is empty.

Types

type C

type C = layout.Context

type CardPalette

type CardPalette struct {
	RedSuit, BlackSuit color.NRGBA
	Border, Background color.NRGBA
}

func (CardPalette) ColorFor

func (p CardPalette) ColorFor(s playing.Suit) color.NRGBA

type CardStyle

type CardStyle struct {
	*material.Theme
	playing.Card
	Height unit.Value
	*CardPalette
}

func (*CardStyle) Layout

func (c *CardStyle) Layout(gtx C) D

func (*CardStyle) Palette

func (c *CardStyle) Palette() *CardPalette

type D

type D = layout.Dimensions

func DrawRect

func DrawRect(gtx C, background color.NRGBA, size f32.Point, radii float32) D

    DrawRect creates a rectangle of the provided background color with Dimensions specified by size and a corner radius (on all corners) specified by radii.

    type HoverCard

    type HoverCard struct {
    	CardStyle
    	*xwidget.HoverState
    }

    func (HoverCard) Layout

    func (h HoverCard) Layout(gtx C) D

    type Rect

    type Rect struct {
    	Color color.NRGBA
    	Size  f32.Point
    	Radii float32
    }

      Rect creates a rectangle of the provided background color with Dimensions specified by size and a corner radius (on all corners) specified by radii.

      func (Rect) Layout

      func (r Rect) Layout(gtx C) D

        Layout renders the Rect into the provided context

        Source Files