Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ColorTransparent is a fully transparent color. ColorTransparent = Color{R: 255, G: 255, B: 255, A: 0} // ColorWhite is white. ColorWhite = Color{R: 255, G: 255, B: 255, A: 255} // ColorBlack is black. ColorBlack = Color{R: 0, G: 0, B: 0, A: 255} // ColorRed is red. ColorRed = Color{R: 255, G: 0, B: 0, A: 255} // ColorGreen is green. ColorGreen = Color{R: 0, G: 128, B: 0, A: 255} // ColorBlue is blue. ColorBlue = Color{R: 0, G: 0, B: 255, A: 255} // ColorSilver is a known color. ColorSilver = Color{R: 192, G: 192, B: 192, A: 255} // ColorMaroon is a known color. ColorMaroon = Color{R: 128, G: 0, B: 0, A: 255} // ColorPurple is a known color. ColorPurple = Color{R: 128, G: 0, B: 128, A: 255} // ColorFuchsia is a known color. ColorFuchsia = Color{R: 255, G: 0, B: 255, A: 255} // ColorLime is a known color. ColorLime = Color{R: 0, G: 255, B: 0, A: 255} // ColorOlive is a known color. ColorOlive = Color{R: 128, G: 128, B: 0, A: 255} // ColorYellow is a known color. ColorYellow = Color{R: 255, G: 255, B: 0, A: 255} ColorNavy = Color{R: 0, G: 0, B: 128, A: 255} // ColorTeal is a known color. ColorTeal = Color{R: 0, G: 128, B: 128, A: 255} // ColorAqua is a known color. ColorAqua = Color{R: 0, G: 255, B: 255, A: 255} )
Basic Colors from: https://www.w3.org/wiki/CSS/Properties/color/keywords
Functions ¶
func ColorChannelFromFloat ¶
ColorChannelFromFloat returns a normalized byte from a given float value.
Types ¶
type Border ¶ added in v0.0.61
type Border struct {
Top bool // Whether to draw the top border
Left bool // Whether to draw the left border
Right bool // Whether to draw the right border
Bottom bool // Whether to draw the bottom border
Width float64 // Width of the border line
Color Color // Color of the border
}
Defines the border style for a cell or table
type Cell ¶ added in v0.0.61
type Cell struct {
Border Border // Border style for the cell
FillColor Color // Background color of the cell
TextColor Color // Color of the text in the cell
Font string // Font name for the cell text
FontSize float64 // Font size for the cell text
}
Defines the style for a cell, including border, fill, text, and font properties
type Color ¶
type Color struct {
R, G, B, A uint8
}
Color is our internal color type because style.Color is bullshit.
func ColorFromAlphaMixedRGBA ¶
ColorFromAlphaMixedRGBA returns the system alpha mixed rgba values.
func ColorFromHex ¶
ColorFromHex returns a color from a css hex code.
NOTE: it will trim a leading '#' character if present.
func ColorFromKnown ¶
ColorFromKnown returns an internal color from a known (basic) color name.
func ColorFromRGB ¶
ColorFromRGB returns a color from an `rgb()` css function.
func ColorFromRGBA ¶
ColorFromRGBA returns a color from an `rgba()` css function.
func (Color) AverageWith ¶
AverageWith averages two colors.
func (Color) IsTransparent ¶
IsTransparent returns if the colors alpha channel is zero.