12345678910111213 |
- class_name ColorUtil
- static func color_from_life(n: int) -> Color:
- var x = float(n % 256) / 255
- if n < 256:
- return Color(x, 1.0, 1.0 - x)
- elif n < 512:
- return Color(1.0, 1.0 - x, x)
- elif n < 768:
- return Color(1.0, 0.0, 1.0 - x)
- else:
- return Color(1.0, 0.0, 0.0)
|