Skip to content

Commit

Permalink
fixed spelling and naming
Browse files Browse the repository at this point in the history
  • Loading branch information
ruslan-ilesik committed Oct 5, 2023
1 parent 1362b69 commit aed1725
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions include/dpp/utility.h
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ namespace dpp {
*
* @param h hue value, between 0 and 1 inclusive
* @param s saturation value in procents, between 0 and 1 inclusive
* @param l ligthness value in procents, between 0 and 1 inclusive
* @param l lightness value in procents, between 0 and 1 inclusive
* @return uint32_t returned integer colour value
*/
uint32_t DPP_EXPORT hsl(double h, double s, double l);
Expand All @@ -435,7 +435,7 @@ namespace dpp {
*
* @param h hue value, between 0 and 356 inclusive
* @param s saturation value in procents, between 0 and 100 inclusive
* @param l ligthness value in procents, between 0 and 100 inclusive
* @param l lightness value in procents, between 0 and 100 inclusive
* @return uint32_t returned integer colour value
*/
uint32_t DPP_EXPORT hsl(int h, int s, int l);
Expand Down
8 changes: 4 additions & 4 deletions src/dpp/utility.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ namespace dpp {
}

uint32_t hsl(double h, double s, double l) {
const auto hueToRgb = [](double p, double q, double t){
const auto hue_to_rgb = [](double p, double q, double t){
if (t < 0) t += 1;
if (t > 1) t -= 1;
if (t < 1.0 / 6.0) return p + (q - p) * 6.0 * t;
Expand All @@ -325,9 +325,9 @@ namespace dpp {
} else {
double q = l < 0.5 ? l * (1 + s) : l + s - l * s;
double p = 2 * l - q;
r = hueToRgb(p, q, h + 1.0 / 3.0);
g = hueToRgb(p, q, h);
b = hueToRgb(p, q, h - 1.0 / 3.0);
r = hue_to_rgb(p, q, h + 1.0 / 3.0);
g = hue_to_rgb(p, q, h);
b = hue_to_rgb(p, q, h - 1.0 / 3.0);
}
return rgb(r,g,b);
}
Expand Down

0 comments on commit aed1725

Please sign in to comment.