Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # equal_spaced_colors.py
- num_steps = 100
- step_size = (256**3) // (num_steps - 1)
- def convert_int_to_rgb(value):
- b = value % 256
- value //= 256
- g = value % 256
- value //= 256
- r = value % 256
- return (r, g, b)
- rgb_values = []
- steps = 0
- while len(rgb_values) < num_steps:
- rgb_values.append(convert_int_to_rgb(steps))
- steps += step_size
- rgb_values[-1] = (255, 255, 255)
- print(rgb_values)
- print(len(rgb_values))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement