Exemplo n.º 1
0
bool AreColoursSimilar(const LSL::lslColor& col1, const LSL::lslColor& col2, int mindiff)
{
	int r, g, b;
	r = col1.Red() - col2.Red();
	g = col1.Green() - col2.Green();
	b = col1.Blue() - col2.Blue();
	r = r > 0 ? r : -r;
	g = g > 0 ? g : -g;
	b = b > 0 ? b : -b;
	int difference = std::min(r, g);
	difference = std::min(difference, b);
	return difference < mindiff;
}
Exemplo n.º 2
0
void test_wxColourTolsl(const unsigned char red, const unsigned char green, const unsigned char blue, const unsigned char alpha)
{
	const wxColor wxcol(red, green, blue, alpha);
	LSL::lslColor lslcol = wxColourTolsl(wxcol);
	BOOST_CHECK(lslcol.Red() == red);
	BOOST_CHECK(lslcol.Green() == green);
	BOOST_CHECK(lslcol.Blue() == blue);
	BOOST_CHECK(lslcol.Alpha() == alpha);
}
Exemplo n.º 3
0
void test_lslToLobbyColour(const unsigned char red, const unsigned char green, const unsigned char blue, const unsigned char alpha)
{
	const LSL::lslColor col(red, green, blue, alpha);

	BOOST_CHECK(col.Red() == red);
	BOOST_CHECK(col.Green() == green);
	BOOST_CHECK(col.Blue() == blue);
	BOOST_CHECK(col.Alpha() == alpha);
	const LSL::lslColor col2(col.GetLobbyColor());

	BOOST_CHECK(col2.Red() == red);
	BOOST_CHECK(col2.Green() == green);
	BOOST_CHECK(col2.Blue() == blue);
	BOOST_CHECK(col2.Alpha() == 255);
}