[Feature request] Support for color scales in conditional formatting

Here is another solution - it won’t get the fine gradient we are after, but it’s a simple formula, using Trigger Formulas.

Stars:

try:
    num = int(value)
    if 1 <= num <= 5:
        return "⭐" * num
    else:
        return ""
except:
    return ""

Colour:

try:
    n = int(value)
    if 1 <= n <= 5:
        colors = ["🟥", "🟧", "🟨", "🟩", "🟦"]
        bar = "".join(colors[i] if i < n else "⬜" for i in range(5))
        return f"{bar}"
    else:
        return ""
except:
    return ""

Colour with %:

try:
    n = int(value)
    if 1 <= n <= 100:
        filled = (n + 19) // 20  # Round up to next block per 20%
        colors = ["🟥", "🟧", "🟨", "🟩", "🟦"]
        bar = "".join(colors[i] if i < filled else "⬜" for i in range(5))
        return f"{bar}  {n}%"
    else:
        return ""
except:
    return ""

Colour 2 with %: (uses 10 blocks instead of 5)

try:
    n = int(value)
    if 1 <= n <= 100:
        filled = (n + 9) // 10  # Round up per 10%
        colors = ["🟥", "🟥", "🟧", "🟧", "🟨", "🟨", "🟩", "🟩", "🟦", "🟦"]
        bar = "".join(colors[i] if i < filled else "⬜" for i in range(10))
        return f"{bar}  {n}%"
    else:
        return ""
except:
    return ""
2 Likes