Skip to content

Commit abdf01c

Browse files
committed
sketchy to gaul color library transition
1 parent bd529c7 commit abdf01c

File tree

13 files changed

+73
-140
lines changed

13 files changed

+73
-140
lines changed

controls.go

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ type Slider struct {
5151
GradientEndColor string `json:"GradientEndColor"`
5252
TextColor string `json:"TextColor"`
5353
DrawRect bool `json:"DrawRect"`
54-
colors ColorConfig
54+
colors gaul.ColorConfig
5555
DidJustChange bool `json:"-"`
5656
fontFamily *canvas.FontFamily
5757
fontFace *canvas.FontFace
@@ -68,7 +68,7 @@ type Toggle struct {
6868
BackgroundColor string `json:"BackgroundColor"`
6969
FillColor string `json:"FillColor"`
7070
TextColor string `json:"TextColor"`
71-
colors ColorConfig
71+
colors gaul.ColorConfig
7272
DidJustChange bool `json:"-"`
7373
wasPressed bool
7474
fontFamily *canvas.FontFamily
@@ -298,10 +298,10 @@ func (t *Toggle) SetFont(ff *canvas.FontFamily) {
298298
}
299299

300300
func (s *Slider) parseColors() {
301-
s.colors.Set(s.BackgroundColor, BackgroundColorType, SliderBackgroundColor)
302-
s.colors.Set(s.OutlineColor, OutlineColorType, SliderOutlineColor)
303-
s.colors.Set(s.TextColor, TextColorType, SliderTextColor)
304-
s.colors.Set(s.FillColor, FillColorType, SliderFillColor)
301+
s.colors.Set(s.BackgroundColor, gaul.BackgroundColorType, SliderBackgroundColor)
302+
s.colors.Set(s.OutlineColor, gaul.OutlineColorType, SliderOutlineColor)
303+
s.colors.Set(s.TextColor, gaul.TextColorType, SliderTextColor)
304+
s.colors.Set(s.FillColor, gaul.FillColorType, SliderFillColor)
305305
if s.UseGradientFill {
306306
c1 := SliderGradientStart
307307
c2 := SliderGradientEnd
@@ -311,13 +311,13 @@ func (s *Slider) parseColors() {
311311
if s.GradientEndColor != "" {
312312
c2 = s.GradientEndColor
313313
}
314-
s.colors.Gradient = NewSimpleGradientFromNamed(c1, c2)
314+
s.colors.Gradient = gaul.NewSimpleGradientFromNamed(c1, c2)
315315
}
316316
}
317317

318318
func (t *Toggle) parseColors() {
319-
t.colors.Set(t.BackgroundColor, BackgroundColorType, ToggleBackgroundColor)
320-
t.colors.Set(t.OutlineColor, OutlineColorType, ToggleOutlineColor)
321-
t.colors.Set(t.TextColor, TextColorType, ToggleTextColor)
322-
t.colors.Set(t.FillColor, FillColorType, ToggleFillColor)
319+
t.colors.Set(t.BackgroundColor, gaul.BackgroundColorType, ToggleBackgroundColor)
320+
t.colors.Set(t.OutlineColor, gaul.OutlineColorType, ToggleOutlineColor)
321+
t.colors.Set(t.TextColor, gaul.TextColorType, ToggleTextColor)
322+
t.colors.Set(t.FillColor, gaul.FillColorType, ToggleFillColor)
323323
}

examples/fractal/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
"github.com/hajimehoshi/ebiten/v2"
1111
)
1212

13-
var synthwavePalette sketchy.Gradient
13+
var synthwavePalette gaul.Gradient
1414

1515
func drawLines(l gaul.Line, n int, p float64, ctx *canvas.Context) {
1616
if n == 0 {
@@ -69,7 +69,7 @@ func main() {
6969
s.Updater = update
7070
s.Drawer = draw
7171
s.Init()
72-
synthwavePalette = sketchy.NewGradientFromNamed([]string{"#1bbbd9", "#f900a4"})
72+
synthwavePalette = gaul.NewGradientFromNamed([]string{"#1bbbd9", "#f900a4"})
7373
ebiten.SetWindowSize(int(s.ControlWidth+s.SketchWidth), int(s.SketchHeight))
7474
ebiten.SetWindowTitle("Sketchy - " + s.Title)
7575
ebiten.SetWindowResizingMode(ebiten.WindowResizingModeDisabled)

examples/lissajous/main.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ func main() {
5757
ebiten.SetWindowSize(int(s.ControlWidth+s.SketchWidth), int(s.SketchHeight))
5858
ebiten.SetWindowTitle("Sketchy - " + s.Title)
5959
ebiten.SetWindowResizingMode(ebiten.WindowResizingModeDisabled)
60-
ebiten.SetFPSMode(ebiten.FPSModeVsyncOffMaximum)
6160
if err := ebiten.RunGame(s); err != nil {
6261
log.Fatal(err)
6362
}

examples/scale_rotate/main.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ func main() {
6565
ebiten.SetWindowSize(int(s.ControlWidth+s.SketchWidth), int(s.SketchHeight))
6666
ebiten.SetWindowTitle("Sketchy - " + s.Title)
6767
ebiten.SetWindowResizingMode(ebiten.WindowResizingModeDisabled)
68-
ebiten.SetFPSMode(ebiten.FPSModeVsyncOffMaximum)
6968
if err := ebiten.RunGame(s); err != nil {
7069
log.Fatal(err)
7170
}

go.mod

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,10 @@ module github.com/aldernero/sketchy
33
go 1.18
44

55
require (
6-
github.com/aldernero/gaul v0.0.0-20230212032317-80af67ca17bf
7-
github.com/hajimehoshi/ebiten/v2 v2.4.16
6+
github.com/aldernero/gaul v0.0.0-20230320013343-9671cb8e2d51
7+
github.com/hajimehoshi/ebiten/v2 v2.5.0
88
github.com/lucasb-eyer/go-colorful v1.2.0
9-
github.com/tdewolff/canvas v0.0.0-20221230020303-9eb6d3934367
10-
golang.org/x/image v0.4.0
9+
github.com/tdewolff/canvas v0.0.0-20230323191751-ed85723e0088
1110
)
1211

1312
require (
@@ -18,21 +17,22 @@ require (
1817
github.com/benoitkugler/textlayout v0.3.0 // indirect
1918
github.com/benoitkugler/textprocessing v0.0.2 // indirect
2019
github.com/dsnet/compress v0.0.1 // indirect
21-
github.com/ebitengine/purego v0.1.1 // indirect
22-
github.com/go-fonts/latin-modern v0.2.0 // indirect
20+
github.com/ebitengine/purego v0.3.1 // indirect
21+
github.com/go-fonts/latin-modern v0.3.0 // indirect
2322
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20221017161538-93cebf72946b // indirect
24-
github.com/go-latex/latex v0.0.0-20210823091927-c0d11ff05a81 // indirect
23+
github.com/go-latex/latex v0.0.0-20230307184459-12ec69307ad9 // indirect
2524
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 // indirect
26-
github.com/hajimehoshi/file2byteslice v1.0.0 // indirect
2725
github.com/jezek/xgb v1.1.0 // indirect
2826
github.com/ojrac/opensimplex-go v1.0.2 // indirect
29-
github.com/tdewolff/minify/v2 v2.12.4 // indirect
27+
github.com/tdewolff/minify/v2 v2.12.5 // indirect
3028
github.com/tdewolff/parse/v2 v2.6.5 // indirect
3129
github.com/wcharczuk/go-chart/v2 v2.1.0 // indirect
32-
golang.org/x/exp/shiny v0.0.0-20230210204819-062eb4c674ab // indirect
33-
golang.org/x/mobile v0.0.0-20221110043201-43a038452099 // indirect
34-
golang.org/x/sys v0.5.0 // indirect
35-
golang.org/x/text v0.7.0 // indirect
30+
golang.org/x/exp/shiny v0.0.0-20230321023759-10a507213a29 // indirect
31+
golang.org/x/image v0.6.0 // indirect
32+
golang.org/x/mobile v0.0.0-20230301163155-e0f57694e12c // indirect
33+
golang.org/x/sync v0.1.0 // indirect
34+
golang.org/x/sys v0.6.0 // indirect
35+
golang.org/x/text v0.8.0 // indirect
3636
gonum.org/v1/plot v0.12.0 // indirect
3737
star-tex.org/x/tex v0.4.0 // indirect
3838
)

0 commit comments

Comments
 (0)