Skip to content

Commit

Permalink
logo dark mode option
Browse files Browse the repository at this point in the history
  • Loading branch information
rcoreilly committed Apr 17, 2024
1 parent 162d8b7 commit c0b7179
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions core/canvas_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func TestCanvasLogo(t *testing.T) {
b := NewBody()
inner := hct.Lighten(colors.Scheme.Primary.Base, 10)
outer := hct.Darken(inner, 30)
core := hct.Saturate(hct.Spin(hct.Lighten(inner, 20), 160), 10)
core := hct.Saturate(hct.Lighten(hct.Spin(inner, 160), 20), 10)

fmt.Println("Outer:", colors.AsHex(outer))
fmt.Println("Inner:", colors.AsHex(inner))
Expand All @@ -46,16 +46,21 @@ func TestCanvasLogo(t *testing.T) {
pc.VectorEffect = styles.VectorEffectNone
pc.StrokeStyle.Width.Dots = 0.2

pc.DrawArc(0.55, 0.5, 0.4, math32.DegToRad(30), math32.DegToRad(30+300))
x := float32(.52)
pc.FillStyle.Color = colors.C(colors.Black)
pc.DrawRectangle(0, 0, 1, 1)
pc.Fill()

pc.DrawArc(x, 0.5, 0.4, math32.DegToRad(30), math32.DegToRad(30+300))
pc.StrokeStyle.Color = colors.C(outer)
pc.Stroke()

pc.DrawArc(0.55, 0.5, 0.22, math32.DegToRad(30), math32.DegToRad(30+300))
pc.DrawArc(x, 0.5, 0.22, math32.DegToRad(30), math32.DegToRad(30+300))
pc.StrokeStyle.Color = colors.C(inner)
pc.Stroke()

pc.FillStyle.Color = colors.C(core)
pc.DrawCircle(0.55, 0.5, 0.15)
pc.DrawCircle(x, 0.5, 0.15)
pc.Fill()
})
b.AssertRender(t, "canvas/logo")
Expand Down

0 comments on commit c0b7179

Please sign in to comment.