color cleanup
Browse files
app.py
CHANGED
|
@@ -62,12 +62,19 @@ def create_row(dim,is_dim=None,checks=None):
|
|
| 62 |
out = "| "
|
| 63 |
n_dim = len(dim)
|
| 64 |
for i in range(n_dim):
|
| 65 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 66 |
color = "green" if checks[i] == "V" else "red"
|
| 67 |
out += f"<strong style='color: {color}'> {dim[i]} </strong>| "
|
|
|
|
| 68 |
elif (is_dim ==1 and i == n_dim-1) or (is_dim ==2 and i ==n_dim-2):
|
| 69 |
color = "blue" if checks[i] == "V" else "yellow"
|
| 70 |
out += f"<strong style='color: {color}'> {dim[i]} </strong>| "
|
|
|
|
| 71 |
else :
|
| 72 |
out+= f"{dim[i]} | "
|
| 73 |
return out + "\n"
|
|
|
|
| 62 |
out = "| "
|
| 63 |
n_dim = len(dim)
|
| 64 |
for i in range(n_dim):
|
| 65 |
+
# infered last dims
|
| 66 |
+
if (is_dim ==1 and i == n_dim-2) or (is_dim ==2 and i ==n_dim-1):
|
| 67 |
+
color = "green"
|
| 68 |
+
out += f"<strong style='color: {color}'> {dim[i]} </strong>| "
|
| 69 |
+
# check every normal dimension
|
| 70 |
+
elif (is_dim ==1 and i != n_dim-1) or (is_dim ==2 and i ==n_dim-1):
|
| 71 |
color = "green" if checks[i] == "V" else "red"
|
| 72 |
out += f"<strong style='color: {color}'> {dim[i]} </strong>| "
|
| 73 |
+
# checks last 2 dims
|
| 74 |
elif (is_dim ==1 and i == n_dim-1) or (is_dim ==2 and i ==n_dim-2):
|
| 75 |
color = "blue" if checks[i] == "V" else "yellow"
|
| 76 |
out += f"<strong style='color: {color}'> {dim[i]} </strong>| "
|
| 77 |
+
# when using this function without checks
|
| 78 |
else :
|
| 79 |
out+= f"{dim[i]} | "
|
| 80 |
return out + "\n"
|