SFML community forums
Help => Graphics => Topic started by: dabo on June 22, 2008, 01:09:50 pm
-
How do you draw a sf::Shape with a color gradient? Let's say I want a rectangle with a red top and a blue bottom. Would be interesting to know the math behind the color calculations.
-
Each point has its own color, then the shape is filled using a simple interpolation between all points.
In this case, you just have to assign a blue color to the 2 top points, and a red color to the 2 bottom points.
-
That was easy, I almost thought you were lying ;) Thanks