Beispiel #1
0
TColor TColor::Sepia()const
{
	TColor tTemp = TColor(r, g, b, a);
	tTemp.r = (r * 0.393f) + (g * 0.769f) + (b * 0.189f);
	tTemp.g = (r * 0.349f) + (g * 0.686f) + (b * 0.168f);
	tTemp.b = (r * 0.272f) + (g * 0.534f) + (b * 0.131f);
	
	tTemp = tTemp.Clamp();

	return tTemp;
}
Beispiel #2
0
TColor TColor::Grayscale()const
{
	TColor tTemp = TColor(r, g, b, a);
	tTemp.r = (r * 0.2126f) + (g * 0.7152f) + (b * 0.0722f);
	tTemp.g = (r * 0.2126f) + (g * 0.7152f) + (b * 0.0722f);
	tTemp.b = (r * 0.2126f) + (g * 0.7152f) + (b * 0.0722f);
	
	tTemp = tTemp.Clamp();

	return tTemp;
}