def r2(t: float) -> Color: c = Color(0, 0, 0) if t == 2: # rock v = randint(64, 192) c.r, c.g, c.b = v, v, v else: # use typecolor c1, c2 = typecolor[t] c.r = randint(c1.r, c2.r) c.g = randint(c1.g, c2.g) c.b = randint(c1.b, c2.b) return c