Fix BackgroundColour documentation. Update changelog. Move contributors into website. Create changelog link.

This commit is contained in:
Lea Anthony
2022-07-25 20:11:04 +10:00
parent 63b47cc852
commit 7ea6f6d28e
13 changed files with 48 additions and 267 deletions
+23 -1
View File
@@ -41,7 +41,9 @@ type App struct {
StartHidden bool
HideWindowOnClose bool
AlwaysOnTop bool
BackgroundColour *RGBA
// BackgroundColour is the background colour of the window
// You can use the options.NewRGB and options.NewRGBA functions to create a new colour
BackgroundColour *RGBA
// RGBA is deprecated. Please use BackgroundColour
RGBA *RGBA
Assets fs.FS
@@ -71,6 +73,26 @@ type RGBA struct {
A uint8 `json:"a"`
}
// NewRGBA creates a new RGBA struct with the given values
func NewRGBA(r, g, b, a uint8) *RGBA {
return &RGBA{
R: r,
G: g,
B: b,
A: a,
}
}
// NewRGB creates a new RGBA struct with the given values and Alpha set to 255
func NewRGB(r, g, b uint8) *RGBA {
return &RGBA{
R: r,
G: g,
B: b,
A: 255,
}
}
// MergeDefaults will set the minimum default values for an application
func MergeDefaults(appoptions *App) {
err := mergo.Merge(appoptions, Default)