File tree 1 file changed +8
-8
lines changed
1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ interface GradientParams {
17
17
type ColorInterpolateFunction = ( input : number ) => string
18
18
19
19
const easeInOut = Easing . bezier ( 0.42 , 0 , 0.58 , 1 )
20
- const TOTAL_STOPS_PER_STEP = 16
20
+ const TOTAL_STOPS_PER_TRANSITION = 16
21
21
22
22
function easeGradient ( { colorStops, easing = easeInOut } : GradientParams ) {
23
23
const colors : string [ ] = [ ]
@@ -51,18 +51,18 @@ function easeGradient({ colorStops, easing = easeInOut }: GradientParams) {
51
51
interpolationConfig
52
52
)
53
53
54
- const stepSize = endLocation - startLocation
55
- const frameSize = 1 / ( TOTAL_STOPS_PER_STEP - 1 )
54
+ const currentTransitionLength = endLocation - startLocation
55
+ const stepSize = 1 / ( TOTAL_STOPS_PER_TRANSITION - 1 )
56
56
57
57
for (
58
- let frameIndex = 0 ;
59
- frameIndex <= TOTAL_STOPS_PER_STEP - 1 ;
60
- frameIndex ++
58
+ let stepIndex = 0 ;
59
+ stepIndex <= TOTAL_STOPS_PER_TRANSITION - 1 ;
60
+ stepIndex ++
61
61
) {
62
- const progress = frameIndex * frameSize
62
+ const progress = stepIndex * stepSize
63
63
const color = colorScale ( progress )
64
64
colors . push ( color )
65
- locations . push ( startLocation + stepSize * progress )
65
+ locations . push ( startLocation + currentTransitionLength * progress )
66
66
}
67
67
}
68
68
You can’t perform that action at this time.
0 commit comments