Navigation: review r1 fixes

This commit is contained in:
ZacharyZhang-NY committed 2026-10-05 12:43:01 -04:00
1 parent a27727bc71
commit 03a3aeaa1f
31 files changed
+386 -44

No files matched your search

+19
View File
@@ -0,0 +1,19 @@
package internal
import (
"math"
"time"
"github.com/egoist/mygo/ui"
)
// Ease moves e's background, border and text color fg to their targets over d.
func Ease(e *ui.Element, d time.Duration, fg ui.Color) *ui.Element {
if d > 0 {
e.Transition(ui.ElementTransition{Colors: true, Duration: d})
}
ch := func(key string, v uint8) uint8 {
return uint8(math.Round(float64(e.Animate(key, float32(v), d))))
}
return e.TextColor(ui.Color{R: ch("mujica.fg.r", fg.R), G: ch("mujica.fg.g", fg.G), B: ch("mujica.fg.b", fg.B), A: ch("mujica.fg.a", fg.A)})
}