Thiago Hersan
commited on
Commit
·
9d28f3d
1
Parent(s):
a4bef5f
comment css_to_rgb
Browse files
app.py
CHANGED
|
@@ -64,6 +64,8 @@ def min_color_distance(ref_color, color_list):
|
|
| 64 |
# `rgb(18, 171, 87)` or
|
| 65 |
# `rgba(18, 171, 87, 1)`
|
| 66 |
# into an RGB list [18, 171, 87]
|
|
|
|
|
|
|
| 67 |
def css_to_rgb(css_str):
|
| 68 |
if css_str[0] == "#":
|
| 69 |
return [int(css_str[i:i+2], 16) for i in range(1,6,2)]
|
|
|
|
| 64 |
# `rgb(18, 171, 87)` or
|
| 65 |
# `rgba(18, 171, 87, 1)`
|
| 66 |
# into an RGB list [18, 171, 87]
|
| 67 |
+
#
|
| 68 |
+
# Needed because of this bug: https://github.com/gradio-app/gradio/issues/12071
|
| 69 |
def css_to_rgb(css_str):
|
| 70 |
if css_str[0] == "#":
|
| 71 |
return [int(css_str[i:i+2], 16) for i in range(1,6,2)]
|