Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # rgb_at_sum.py
- combos = []
- def rgb_at_sum(target_sum):
- min_g = target_sum - 256
- for r in range(256):
- for g in range(min_g, target_sum - r + 1):
- b = target_sum - r - g
- rgb = r, g, b
- print(rgb, sum(rgb), [target_sum])
- combos.append(rgb)
- target_sum = 128 * 3 # or any other desired target sum
- rgb_at_sum(target_sum)
- print(len(combos))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement