Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Background ¶
type Background struct { Primary RGBA `json:"primary"` Secondary RGBA `json:"secondary"` TextureIndex int `json:"textureIndex"` }
Background describes how the background of a rectangle should be colored. It defines a primary and secondary color and optionally the index of a texture that should be used to merge the colors.
If not texture is specified, the background is drawn using only the Primary color.
type Font ¶
type Font struct { FamilyIndex int `json:"familyIndex"` Size FontSize `json:"size"` Style FontStyle `json:"style"` Color RGBA `json:"color"` }
Font describes the font used for drawing text.
type FontSize ¶
type FontSize int
FontSize describes the size of a font. Font sizes are relative to the screen size.
const ( // SmallFont is the smallest size available SmallFont FontSize = iota // ContentFont is the size used for content text by default. ContentFont // MediumFont is a size between Content and Heading. MediumFont // HeadingFont is the size used for heading text by default. HeadingFont // LargeFont is a size larger than Heading. LargeFont // HugeFont is the largest font; usually used for displaying a single word // on the screen. HugeFont // NumFontSizes is not a valid Size, but used for iterating NumFontSizes )
func (FontSize) MarshalYAML ¶
MarshalYAML maps the given font size to a string
func (*FontSize) UnmarshalYAML ¶
UnmarshalYAML sets the font size from a YAML scalar
type FontStyle ¶
type FontStyle int
FontStyle describes possible styles of a font
const ( // RegularFont is the default font style RegularFont FontStyle = iota // BoldFont is the bold font style BoldFont // ItalicFont is the italic font style ItalicFont // BoldItalicFont is the bold and italic font style BoldItalicFont // NumFontStyles is not a valid Style, but used for iterating. NumFontStyles )
func (FontStyle) MarshalYAML ¶
MarshalYAML maps the given font style to a string
func (*FontStyle) UnmarshalYAML ¶
UnmarshalYAML sets the font style from a YAML scalar
type RGB ¶
RGB represents a color in RGB color space.
func (RGB) AsBackground ¶
func (c RGB) AsBackground() Background
AsBackground returns a Background with c as background color and no texture.
func (*RGB) FromHexRepr ¶
FromHexRepr loads a representation with leading '#' and two hex digits per color into the given object.
func (RGB) HexRepr ¶
HexRepr returns the color rendered with leading '#' and two hex digits per color.
func (*RGB) MarshalJSON ¶
MarshalJSON represents the color as JSON string containing a HTML hexcode
func (*RGB) UnmarshalJSON ¶
UnmarshalJSON loads a JSON string as HTML hexcode into RGBColor
type RGBA ¶
RGBA represents a color in RGB color space with alpha channel
func (RGBA) AsBackground ¶
func (c RGBA) AsBackground() Background
AsBackground returns a Background with c as background color and no texture.
func (*RGBA) FromHexRepr ¶
FromHexRepr loads a representation with leading '#' and two hex digits per color into the given object.
func (RGBA) HexRepr ¶
HexRepr returns the color rendered with leading '#' and two hex digits per color.
func (*RGBA) MarshalJSON ¶
MarshalJSON represents the color as JSON string containing a HTML hexcode
func (*RGBA) UnmarshalJSON ¶
UnmarshalJSON loads a JSON string as HTML hexcode into RGBAColor
func (RGBA) WithoutAlpha ¶
WithoutAlpha returns the color without the Alpha component