Skip to content

Commit

Permalink
Use initializer_list for max and min calls.
Browse files Browse the repository at this point in the history
  • Loading branch information
j4james committed Aug 13, 2024
1 parent 38330d1 commit dd8be4e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/types/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -465,8 +465,8 @@ std::tuple<int, int, int> Utils::ColorToHLS(const til::color color) noexcept
// This calculation is based on the RGB to HSL algorithm described in
// Wikipedia: https://en.wikipedia.org/wiki/HSL_and_HSV#From_RGB
// We start by calculating the maximum and minimum component values.
const auto maxComp = std::max(std::max(red, green), blue);
const auto minComp = std::min(std::min(red, green), blue);
const auto maxComp = std::max({ red, green, blue });
const auto minComp = std::min({ red, green, blue });

// The chroma value is the range of those components.
const auto chroma = maxComp - minComp;
Expand Down

0 comments on commit dd8be4e

Please sign in to comment.