Esempio n. 1
0
ColorRGBA ColorRGBA::Decomposite(const ColorRGBA& foreground) const
{
	ColorRGBA result = *this;

	result = (result - foreground * foreground.Alpha()) / (1 - foreground.Alpha());
	result.SetAlpha(1.f);

	return result;
}
Esempio n. 2
0
ColorRGBA ColorRGBA::Composite(const ColorRGBA& foreground) const
{
	ColorRGBA result = *this;

	result = result * (1 - foreground.Alpha()) + foreground * foreground.Alpha();
	result.SetAlpha(1.f);

	return result;
}