Skip to content

Commit

Permalink
modify gradient
Browse files Browse the repository at this point in the history
  • Loading branch information
tahmid-23 committed Jul 12, 2023
1 parent 06fe5cc commit 901a399
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,12 @@ private ComponentLike lerpColorRecursive(Component component, float progress) {
children.add(lerpColorRecursive(child, progress));
}

TextColor oldColor = component.color();
if (oldColor == null) {
oldColor = coinsInfo.gradientFrom();
TextColor toColor = component.color();
if (toColor == null) {
toColor = coinsInfo.gradientTo();
}

TextColor newColor = TextColor.lerp(progress, oldColor, coinsInfo.gradientTo());
TextColor newColor = TextColor.lerp(progress, coinsInfo.gradientFrom(), toColor);
return component.children(children).color(newColor);
}

Expand Down

0 comments on commit 901a399

Please sign in to comment.