From ecf4ad9eb57bb381bbf25005bf7a1357b7a8b9d4 Mon Sep 17 00:00:00 2001 From: algobytewise Date: Mon, 12 Apr 2021 16:20:43 +0530 Subject: [PATCH] update RgbHsvConversion.js --- Conversions/RgbHsvConversion.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Conversions/RgbHsvConversion.js b/Conversions/RgbHsvConversion.js index 3cb94202b..41d7b14aa 100644 --- a/Conversions/RgbHsvConversion.js +++ b/Conversions/RgbHsvConversion.js @@ -3,7 +3,7 @@ * together in various ways to reproduce a broad array of colors. The name of the model comes from * the initials of the three additive primary colors, red, green, and blue. Meanwhile, the HSV * representation models how colors appear under light. In it, colors are represented using three - * components: hue, saturation and (brightness-)value. This class provides methods for converting + * components: hue, saturation and (brightness-)value. This file provides functions for converting * colors from one representation to the other. (description adapted from * https://en.wikipedia.org/wiki/RGB_color_model and https://en.wikipedia.org/wiki/HSL_and_HSV). */ @@ -142,6 +142,10 @@ function approximatelyEqualHsv (hsv1, hsv2) { function getRgbBySection ( hueSection, chroma, matchValue, secondLargestComponent) { + function convertToInt (input) { + return Math.round(255 * input) + } + let red let green let blue @@ -174,7 +178,3 @@ function getRgbBySection ( return [red, green, blue] } - -function convertToInt (input) { - return Math.round(255 * input) -}