Checkpoint
This commit is contained in:
223 files changed
+14770
-18352
No files matched your search
+51
-10
@@ -5,8 +5,9 @@ import (
|
||||
"image/color"
|
||||
"image/draw"
|
||||
|
||||
"github.com/BeatGlow/beatglow/ui/font"
|
||||
"github.com/BeatGlow/display/pixel"
|
||||
|
||||
"github.com/BeatGlow/beatglow/app/font"
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -29,28 +30,29 @@ var (
|
||||
}
|
||||
defaultMonoThemeStyles = Styles{
|
||||
Window: defaultMonoObjectStyle,
|
||||
Progress: defaultMonoObjectStyle.WithBorder(1),
|
||||
Progress: defaultMonoObjectStyle,
|
||||
Image: defaultMonoObjectStyle,
|
||||
Graph: defaultMonoObjectStyle,
|
||||
Text: TextStyle{
|
||||
ObjectStyle: defaultMonoObjectStyle.WithMargin(1),
|
||||
ObjectStyle: defaultMonoObjectStyle,
|
||||
Font: font.SmoochSans,
|
||||
},
|
||||
}
|
||||
|
||||
defaultGrayObjectStyle = ObjectStyle{
|
||||
Background: image.Black,
|
||||
BackgroundColor: color.Black,
|
||||
ForegroundColor: color.White,
|
||||
BorderColor: color.Gray{Y: 0x7F},
|
||||
BorderColor: color.Gray{Y: 0xBF},
|
||||
}
|
||||
defaultGrayThemeStyles = Styles{
|
||||
Window: defaultGrayObjectStyle,
|
||||
Progress: defaultGrayObjectStyle.WithBorder(1),
|
||||
Progress: defaultGrayObjectStyle,
|
||||
Image: defaultGrayObjectStyle,
|
||||
Graph: defaultGrayObjectStyle,
|
||||
Text: TextStyle{
|
||||
ObjectStyle: defaultGrayObjectStyle.WithMargin(1),
|
||||
Font: font.SmoochSans,
|
||||
ObjectStyle: defaultGrayObjectStyle, // .WithMargin(1),
|
||||
Font: font.Spleen5x8,
|
||||
},
|
||||
}
|
||||
|
||||
@@ -61,11 +63,11 @@ var (
|
||||
}
|
||||
defaultColorThemeStyles = Styles{
|
||||
Window: defaultColorObjectStyle,
|
||||
Progress: defaultColorObjectStyle.WithBorder(1).Inverse(),
|
||||
Progress: defaultColorObjectStyle, // .WithBorder(1).Inverse(),
|
||||
Image: defaultColorObjectStyle,
|
||||
Graph: defaultColorObjectStyle,
|
||||
Text: TextStyle{
|
||||
ObjectStyle: defaultColorObjectStyle.WithMargin(1),
|
||||
ObjectStyle: defaultColorObjectStyle, // .WithMargin(1),
|
||||
Font: font.SmoochSans,
|
||||
},
|
||||
}
|
||||
@@ -137,6 +139,22 @@ type ObjectStyle struct {
|
||||
Stroke int
|
||||
}
|
||||
|
||||
func (s ObjectStyle) WithBackgroundColor(c color.Color) ObjectStyle {
|
||||
i := new(ObjectStyle)
|
||||
*i = s
|
||||
i.Background = nil
|
||||
i.BackgroundColor = c
|
||||
return *i
|
||||
}
|
||||
|
||||
func (s ObjectStyle) WithForegroundColor(c color.Color) ObjectStyle {
|
||||
i := new(ObjectStyle)
|
||||
*i = s
|
||||
i.Foreground = nil
|
||||
i.ForegroundColor = c
|
||||
return *i
|
||||
}
|
||||
|
||||
func (s ObjectStyle) Inverse() ObjectStyle {
|
||||
i := new(ObjectStyle)
|
||||
*i = s
|
||||
@@ -246,7 +264,30 @@ func (s ObjectStyle) Inner(i draw.Image) draw.Image {
|
||||
|
||||
type TextStyle struct {
|
||||
ObjectStyle
|
||||
Font *font.Font
|
||||
Font font.Font
|
||||
}
|
||||
|
||||
func (s TextStyle) WithBackgroundColor(c color.Color) TextStyle {
|
||||
i := new(TextStyle)
|
||||
*i = s
|
||||
i.Background = nil
|
||||
i.BackgroundColor = c
|
||||
return *i
|
||||
}
|
||||
|
||||
func (s TextStyle) WithForegroundColor(c color.Color) TextStyle {
|
||||
i := new(TextStyle)
|
||||
*i = s
|
||||
i.Foreground = nil
|
||||
i.ForegroundColor = c
|
||||
return *i
|
||||
}
|
||||
|
||||
func (s TextStyle) WithFont(font font.Font) TextStyle {
|
||||
return TextStyle{
|
||||
ObjectStyle: s.ObjectStyle,
|
||||
Font: font,
|
||||
}
|
||||
}
|
||||
|
||||
type Edge struct {
|
||||
|
||||
Reference in new issue
Block a user