summaryrefslogtreecommitdiff
path: root/tests/core
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2022-04-13 10:37:22 +0200
committerRémi Verschelde <rverschelde@gmail.com>2022-04-13 11:45:52 +0200
commit46ef52162eee2bdddb44a15fc8bf37aeb1aa3f48 (patch)
tree10204054589c63e293b415c8e5d7ecc1e85fd47b /tests/core
parent8904731b8b0a8560c43a8b6680546d8f67f47bb7 (diff)
Color: Rename `to_srgb`/`to_linear` to include base color space
This helps reduce confusion around sRGB <> Linear conversions by making both input and output color spaces explicit.
Diffstat (limited to 'tests/core')
-rw-r--r--tests/core/math/test_color.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/core/math/test_color.h b/tests/core/math/test_color.h
index 6f40f8ecc0..51c3bc8bdc 100644
--- a/tests/core/math/test_color.h
+++ b/tests/core/math/test_color.h
@@ -146,8 +146,8 @@ TEST_CASE("[Color] Conversion methods") {
TEST_CASE("[Color] Linear <-> sRGB conversion") {
const Color color = Color(0.35, 0.5, 0.6, 0.7);
- const Color color_linear = color.to_linear();
- const Color color_srgb = color.to_srgb();
+ const Color color_linear = color.srgb_to_linear();
+ const Color color_srgb = color.linear_to_srgb();
CHECK_MESSAGE(
color_linear.is_equal_approx(Color(0.100481, 0.214041, 0.318547, 0.7)),
"The color converted to linear color space should match the expected value.");
@@ -155,10 +155,10 @@ TEST_CASE("[Color] Linear <-> sRGB conversion") {
color_srgb.is_equal_approx(Color(0.62621, 0.735357, 0.797738, 0.7)),
"The color converted to sRGB color space should match the expected value.");
CHECK_MESSAGE(
- color_linear.to_srgb().is_equal_approx(Color(0.35, 0.5, 0.6, 0.7)),
+ color_linear.linear_to_srgb().is_equal_approx(Color(0.35, 0.5, 0.6, 0.7)),
"The linear color converted back to sRGB color space should match the expected value.");
CHECK_MESSAGE(
- color_srgb.to_linear().is_equal_approx(Color(0.35, 0.5, 0.6, 0.7)),
+ color_srgb.srgb_to_linear().is_equal_approx(Color(0.35, 0.5, 0.6, 0.7)),
"The sRGB color converted back to linear color space should match the expected value.");
}