Skip to content

Commit cb2d5b5

Browse files
committed
Fixes issue with color interpolation
Former-commit-id: fcf09a4
1 parent 5113404 commit cb2d5b5

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

cocos2d/ccTypes.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -171,11 +171,11 @@ static inline ccColor3B ccc3BFromccc4F(ccColor4F c)
171171
*/
172172
static inline ccColor4F ccc4FInterpolated(ccColor4F start, ccColor4F end, float t)
173173
{
174-
start.r = end.r + (start.r - end.r ) * t;
175-
start.g = end.g + (start.g - end.g ) * t;
176-
start.b = end.b + (start.b - end.b ) * t;
177-
start.a = end.a + (start.a - end.a ) * t;
178-
return start;
174+
end.r = start.r + (end.r - start.r ) * t;
175+
end.g = start.g + (end.g - start.g ) * t;
176+
end.b = start.b + (end.b - start.b ) * t;
177+
end.a = start.a + (end.a - start.a ) * t;
178+
return end;
179179
}
180180

181181
/** A vertex composed of 2 GLfloats: x, y

0 commit comments

Comments
 (0)