blob: 1901e4ba1ec4e683c7a6b41c203879ae1a932801 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
package ui
import (
rl "github.com/gen2brain/raylib-go/raylib"
)
type Style struct {
BacgroundColor *rl.Color
FontColor *rl.Color
Padding *float32
}
// Fills up not specifiend elements with default ones
func (base *Style) FillMissing(defaultStyle *Style) {
if base.BacgroundColor == nil {
base.BacgroundColor = defaultLabelStyle.BacgroundColor
}
if base.Padding == nil {
base.Padding = defaultLabelStyle.Padding
}
if base.FontColor == nil {
base.FontColor = defaultLabelStyle.FontColor
}
}
|