Skip to content

Commit

Permalink
Add interp.Color
Browse files Browse the repository at this point in the history
  • Loading branch information
unitoftime committed Oct 27, 2024
1 parent 1692f70 commit 12bee01
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions interp/interp.go
Original file line number Diff line number Diff line change
Expand Up @@ -321,3 +321,12 @@ type MultFunc struct {
func (f MultFunc) Interp(t float64) float64 {
return f.A.Interp(t) * f.B.Interp(t)
}

func Color(lerp Interp, start, finish glm.RGBA, val float64) glm.RGBA {
return glm.RGBA{
R: lerp.Float64(start.R, finish.R, val),
G: lerp.Float64(start.G, finish.G, val),
B: lerp.Float64(start.B, finish.B, val),
A: lerp.Float64(start.A, finish.A, val),
}
}

0 comments on commit 12bee01

Please sign in to comment.