Skip to content

Commit

Permalink
fixing color interpolation (thanks clang) refs #36
Browse files Browse the repository at this point in the history
git-svn-id: file:///home/behr_mi/git/sumo_synched/trunk/sumo@16671 afbd958f-9f77-42d5-a016-97a22340ccf4
  • Loading branch information
namdre committed Jun 27, 2014
1 parent 3dfc6ee commit 0b59702
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/utils/common/RGBColor.cpp
Expand Up @@ -275,10 +275,10 @@ RGBColor::interpolate(const RGBColor& minColor, const RGBColor& maxColor, SUMORe
if (weight > 1) {
weight = 1;
}
const unsigned char r = minColor.myRed + static_cast<char>((maxColor.myRed - minColor.myRed) * weight);
const unsigned char g = minColor.myGreen + static_cast<char>((maxColor.myGreen - minColor.myGreen) * weight);
const unsigned char b = minColor.myBlue + static_cast<char>((maxColor.myBlue - minColor.myBlue) * weight);
const unsigned char a = minColor.myAlpha + static_cast<char>((maxColor.myAlpha - minColor.myAlpha) * weight);
const unsigned char r = (unsigned char)((int)minColor.myRed + (((int)maxColor.myRed - (int)minColor.myRed) * weight));
const unsigned char g = (unsigned char)((int)minColor.myGreen + (((int)maxColor.myGreen - (int)minColor.myGreen) * weight));
const unsigned char b = (unsigned char)((int)minColor.myBlue + (((int)maxColor.myBlue - (int)minColor.myBlue) * weight));
const unsigned char a = (unsigned char)((int)minColor.myAlpha + (((int)maxColor.myAlpha - (int)minColor.myAlpha) * weight));
return RGBColor(r, g, b, a);
}

Expand Down

0 comments on commit 0b59702

Please sign in to comment.