TheBird

colors.py

1.0 kB · python · 37 lines

1from mrlypy.core.colors import Color, gradient2import random34alpha = Color(0, 0, 0, 0)5black = Color(0, 0, 0)6white = Color(255, 255, 255)7red = Color(255, 61, 64)8orange = Color(255, 143, 44)9yellow = Color(255, 209, 0)10green = Color(50, 204, 88)11mint = Color(0, 209, 187)12teal = Color(0, 202, 216)13cyan = Color(30, 201, 243)14blue = Color(0, 140, 255)15indigo = Color(103, 104, 250)16purple = Color(211, 50, 233)17pink = Color(255, 50, 90)18brown = Color(177, 132, 98)19gray = Color(142, 142, 147)2021primaries = [black, white]22secondaries = [red, orange, yellow, green, mint, teal, cyan, blue, indigo, purple, pink, brown, gray]2324def random_color():25    choices = [alpha, black, white, red, orange, yellow, green, mint, teal, cyan, blue, indigo, purple, pink, brown, gray]26    return random.choice(choices)2728def random_primary():29    return random.choice(primaries)3031def random_secondary():32    return random.choice(secondaries)3334def random_gradient(steps: int = 10):35    c1, c2 = random.sample(secondaries, 2)36    colors = gradient([c1, c2], steps)37    return colors