summaryrefslogtreecommitdiff
path: root/color-converter.py
diff options
context:
space:
mode:
Diffstat (limited to 'color-converter.py')
-rw-r--r--color-converter.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/color-converter.py b/color-converter.py
index 324d271..9f5620d 100644
--- a/color-converter.py
+++ b/color-converter.py
@@ -349,7 +349,6 @@ def RGBtoHSVorHSL(rgbValues, convertTo) :
chroma = xMax - xMin
# Convert by following formula
-
value = xMax
lightness = (xMax + xMin) / 2
@@ -501,9 +500,11 @@ def extractValues(color, numValues, isHex = False) :
while i < len(color) :
if color[i].isnumeric() or color[i] == '.' :
tempValue += color[i]
- elif len(tempValue) > 0 :
+ elif len(tempValue) > 0 and tempValue != '.' :
extractedValues.append(tempValue)
tempValue = ''
+ else :
+ tempValue = ''
if len(extractedValues) == numValues :
break
i = i + 1