mirror of
https://github.com/Redot-Engine/redot-engine.git
synced 2025-12-06 15:21:56 -05:00
Fix Color test cases for RGBA
This commit is contained in:
@@ -39,9 +39,7 @@ namespace TestColor {
|
|||||||
|
|
||||||
TEST_CASE("[Color] Constructor methods") {
|
TEST_CASE("[Color] Constructor methods") {
|
||||||
const Color blue_rgba = Color(0.25098, 0.376471, 1, 0.501961);
|
const Color blue_rgba = Color(0.25098, 0.376471, 1, 0.501961);
|
||||||
// HTML currently uses ARGB notation, which is contrary to the CSS standard.
|
const Color blue_html = Color::html("#4060ff80");
|
||||||
// This may be changed to RGBA in 4.0.
|
|
||||||
const Color blue_html = Color::html("#804060ff");
|
|
||||||
const Color blue_hex = Color::hex(0x4060ff80);
|
const Color blue_hex = Color::hex(0x4060ff80);
|
||||||
const Color blue_hex64 = Color::hex64(0x4040'6060'ffff'8080);
|
const Color blue_hex64 = Color::hex64(0x4040'6060'ffff'8080);
|
||||||
|
|
||||||
@@ -118,10 +116,10 @@ TEST_CASE("[Color] Conversion methods") {
|
|||||||
const Color cyan_transparent = Color(0, 1, 1, 0);
|
const Color cyan_transparent = Color(0, 1, 1, 0);
|
||||||
|
|
||||||
CHECK_MESSAGE(
|
CHECK_MESSAGE(
|
||||||
cyan.to_html() == "ff00ffff",
|
cyan.to_html() == "00ffffff",
|
||||||
"The returned RGB HTML color code should match the expected value.");
|
"The returned RGB HTML color code should match the expected value.");
|
||||||
CHECK_MESSAGE(
|
CHECK_MESSAGE(
|
||||||
cyan_transparent.to_html() == "0000ffff",
|
cyan_transparent.to_html() == "00ffff00",
|
||||||
"The returned RGBA HTML color code should match the expected value.");
|
"The returned RGBA HTML color code should match the expected value.");
|
||||||
CHECK_MESSAGE(
|
CHECK_MESSAGE(
|
||||||
cyan.to_argb32() == 0xff00ffff,
|
cyan.to_argb32() == 0xff00ffff,
|
||||||
|
|||||||
Reference in New Issue
Block a user