• ⚠️ UK Access Block Notice: Beginning July 1, 2025, this site will no longer be accessible from the United Kingdom. This is a voluntary decision made by the site's administrators. We were not forced or ordered to implement this block. If you're located in the UK, we recommend using a VPN to maintain access.

Unbearable Mr. Bear

Unbearable Mr. Bear

Sometimes, all you need is a hug...
May 9, 2025
682
So, there's something that has been something I play with to take my head off the gutter: Coloraide. Coloraide is a python library that is basically color theory central. It can use a shit ton of colorspaces, blend colors with a multitude of methods, create gradients and spectra based on many different rules, it's amazing and activates my monke neuron very much.

But it is a library, so you need to learn python, and that's what I did. Now, I'm no coder, but I really wanted to use the tool so it pushed me forward. Good news is, the website has a lot of clear documentation, with interactive examples, AND a playground, so you can try Coloraide online, without installing anything! https://facelessuser.github.io/coloraide/playground/

I'm posting this here because it could be useful to artists. I'm more of a music person, but I just adore messing around with it, so if you feel like you want something related to color theory, like palettes, gradients, or just visualizing colors, I can code for you. I'll do it happily, I love messing around with the tool, and that would make me feel useful!

Here's an example of what I did in 10 minutes: A palette generator (Mostly for pixel art)
Python:
pal_final = [Color("#000"), Color("#FFF")]
pal_lim = 16
iter = 10000
init_tresh = 1000
tresh = init_tresh

while len(pal_final) < pal_lim and iter >= 0:
    col_ng = False
    new_col = Color.random("srgb")
    for pal_col in pal_final:
        iter -= 1
        if new_col.delta_e(pal_col) < tresh:
            col_ng = True
            tresh *= 0.99
        if col_ng:
            break
    if not col_ng:
        tresh = init_tresh
        pal_final.append(new_col)

iter
len(pal_final)
pal_final

If you paste the code on the "Playground" page, it generates an 8 color palette including black and white, using color delta to make sure the colors are different enough. pal_lim is the size of the final palette, if you wanna change that.

Well there you have it, thanks for reading and I look forward for requests!
 
Last edited:
  • Love
  • Like
Reactions: GlassMoon, Forveleth and kotonearisato
kotonearisato

kotonearisato

memento mori
Feb 13, 2024
119
Whoa, this is awesome. Thanks for sharing! I actually spent some time earlier in the year learning python, so I'm excited to try this out.
 
  • Love
Reactions: Unbearable Mr. Bear
Unbearable Mr. Bear

Unbearable Mr. Bear

Sometimes, all you need is a hug...
May 9, 2025
682
Whoa, this is awesome. Thanks for sharing! I actually spent some time earlier in the year learning python, so I'm excited to try this out.
Glad I could pique your interest. It is an amazing tool but more of a fun toy for me since I'm not into drawing or painting. If you need any tips I already use this tool for like 2/3 years so I have lots of experience.

Really, though, I'm happy I could make you happy. 🧸
 
  • Love
Reactions: kotonearisato
Unbearable Mr. Bear

Unbearable Mr. Bear

Sometimes, all you need is a hug...
May 9, 2025
682
Here's an updated version of the palette generator. Now with a better algorithm for calculating stuff and shit:

Python:
pal_final = [Color("#000"), Color("#FFF")]
pal_lim = 32
iter = 10000
init_tresh = 100
tresh = init_tresh

while len(pal_final) < pal_lim and iter >= 0:
    col_ng = False
    new_col = Color.random("srgb")
    for pal_col in pal_final:
        iter -= 1
        if new_col.delta_e(pal_col, method="hyab", space="cam16-ucs") < tresh:
            col_ng = True
            tresh *= 0.98
        if col_ng:
            break
    if not col_ng:
        print(round(tresh, 2), end=" ")
        tresh = (tresh + init_tresh) / 2
        pal_final.append(new_col)

print(end="")
iter
len(pal_final)
pal_final
 
Lady Laudanum

Lady Laudanum

Here for a bad time, not a long time
May 9, 2024
874
Error: need pet snake in order to make palette (unfunny joke about python)
 
  • Yay!
Reactions: Unbearable Mr. Bear
Unbearable Mr. Bear

Unbearable Mr. Bear

Sometimes, all you need is a hug...
May 9, 2025
682
Unbearable Mr. Bear

Unbearable Mr. Bear

Sometimes, all you need is a hug...
May 9, 2025
682
New version of the palette generator! Now it shows the colors as hex values, and you can click the color to copy the value. There's also a list of all hex values at the bottom of the output. I also made it sort by hue so the output is a little bit preetier!

EDIT: OH GOD I FORGOT TO ACTUALLY CODE HOLD ON!

Python:
pal_final = [Color("#000"), Color("#FFF")]
pal_lim = 16
iter = 25000
init_tresh = 100
tresh = init_tresh

while len(pal_final) < pal_lim and iter >= 0:
    col_ng = False
    new_col = Color.random("srgb")
    for pal_col in pal_final:
        iter -= 1
        if new_col.delta_e(pal_col, method="hyab", space="cam16-ucs") < tresh:
            col_ng = True
            tresh *= 0.99
        if col_ng:
            break
    if not col_ng:
        print(round(tresh, 2), end=" ")
        tresh = (tresh + init_tresh) / 2
        pal_final.append(new_col)

print(end="")
iter
len(pal_final)
pal_final[:2]
for pal_col in sorted(pal_final[2:], key=lambda col: col.get("zcam-jmh.h")):
    print(pal_col.to_string(hex=True), end=" ")

PHEW...that was close...

Don't hesitate to call me if you want something done in Coloraide. Color theory is my passion. 🐸
 
Last edited:
  • Like
Reactions: GlassMoon
Unbearable Mr. Bear

Unbearable Mr. Bear

Sometimes, all you need is a hug...
May 9, 2025
682
Another version, this time with 2 alternate methods, if you wanna try it out.

Python:
def calcThres(col_a, col_b):
    return col_a.delta_e(col_b, method="hyab", space="cam16-ucs")

def calcThresAlt(col_a, col_b):
    return col_a.distance(col_b, space="hellwig-hk-jmh")

def calcThresAltB(col_a, col_b):
    return col_a.delta_e(col_b, method="2000", space="lab-d65")

pal_final = [Color("#000"), Color("#FFF")]
pal_lim = 64
iter = 50000
init_thres = 100
thres = init_thres

while len(pal_final) < pal_lim and iter >= 0:
    col_ng = False
    new_col = Color.random("srgb")
    for pal_col in pal_final:
        iter -= 1
        if calcThres(new_col, pal_col) < thres:
            col_ng = True
            thres *= 0.99
        if col_ng:
            break
    if not col_ng:
        print(round(thres, 0), end=" ")
        thres = (thres + init_thres) / 2
        pal_final.append(new_col)

print(end="")
iter
len(pal_final)
pal_final[:2]

for pal_col in sorted(pal_final[2:], key=lambda col: col.get("hellwig-hk-jmh.h")):
    print(pal_col.to_string(hex=True), end=" ")