Skip to content

Commit

Permalink
Add tests for hot_to_cold_color_ramp
Browse files Browse the repository at this point in the history
GitOrigin-RevId: c8de2103f674b373a1e000b160374c5668c91e99
  • Loading branch information
Vertexwahn committed Jun 22, 2024
1 parent fa004b8 commit 54ea7e9
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions devertexwahn/imaging/color_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,3 +128,17 @@ TEST(Color3f, to_string) {
Color3f c{.5f, .6f, .7f};
EXPECT_THAT(c.to_string(), "0.5, 0.6, 0.7");
}

TEST(Color3f, hot_to_cold_color_ramp) {
Color3f cold = hot_to_cold_color_ramp(.0f, .0f, 1.f);

EXPECT_THAT(cold.red(), 0.0f);
EXPECT_THAT(cold.green(), 0.0f);
EXPECT_THAT(cold.blue(), 1.0f);

Color3f hot = hot_to_cold_color_ramp(1.f, .0f, 1.f);

EXPECT_THAT(hot.red(), 1.0f);
EXPECT_THAT(hot.green(), 0.0f);
EXPECT_THAT(hot.blue(), 0.0f);
}

0 comments on commit 54ea7e9

Please sign in to comment.