summaryrefslogtreecommitdiff
path: root/color-converter.py
diff options
context:
space:
mode:
authorSimon <vesspa0330@gmail.com>2025-01-20 01:35:49 -0500
committerSimon <vesspa0330@gmail.com>2025-01-20 01:35:49 -0500
commit04afd19a53c6773df4ed7fea7aaf2ddf8707cc8c (patch)
tree7b09b1a23eb3815d7ce070d5608925175bab74d9 /color-converter.py
parentfd9e5533b96b3da0fc9834ed942074a9d96e167d (diff)
big readme overhaul, full instructions on flags and such now
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