Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import colorsys
- def main():
- colours = []
- while True:
- inp = raw_input()
- if inp == 'q':
- break
- rgb = ()
- try:
- rgb = tuple(map(float, inp.split(" ")))
- except ValueError:
- continue
- colours.append(rgb)
- colours.sort(key=lambda rgb: colorsys.rgb_to_hsv(*rgb))
- for (r, g, b) in colours:
- print('{} {} {}'.format(int(r), int(g), int(b)))
- if __name__ == '__main__':
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement