Added a flag to enable 24bit color output in images.
[rainbowstream.git] / rainbowstream / rainbow.py
index 53fcd639f4ef2b83929f899fa74a53a8d8c3b879..cf25883ed5d14a5bf9de67f795b84479e753d541 100644 (file)
@@ -67,6 +67,11 @@ def parse_arguments():
         '--image-on-term',
         action='store_true',
         help='Display all image on terminal.')
         '--image-on-term',
         action='store_true',
         help='Display all image on terminal.')
+    parser.add_argument(
+        '-24',
+        '--color-24bit',
+        action='store_true',
+        help='Display images using 24bit color codes.')
     parser.add_argument(
         '-ph',
         '--proxy-host',
     parser.add_argument(
         '-ph',
         '--proxy-host',
@@ -233,6 +238,7 @@ def init(args):
     c['message_dict'] = []
     # Image on term
     c['IMAGE_ON_TERM'] = args.image_on_term
     c['message_dict'] = []
     # Image on term
     c['IMAGE_ON_TERM'] = args.image_on_term
+    c['24BIT'] = args.color_24bit
     set_config('IMAGE_ON_TERM', str(c['IMAGE_ON_TERM']))
     # Check type of ONLY_LIST and IGNORE_LIST
     if not isinstance(c['ONLY_LIST'], list):
     set_config('IMAGE_ON_TERM', str(c['IMAGE_ON_TERM']))
     # Check type of ONLY_LIST and IGNORE_LIST
     if not isinstance(c['ONLY_LIST'], list):
@@ -1291,7 +1297,7 @@ def switch():
             return
         # Kill old thread
         g['stream_stop'] = True
             return
         # Kill old thread
         g['stream_stop'] = True
-        try: 
+        try:
             stuff = g['stuff'].split()[1]
         except:
             stuff = None
             stuff = g['stuff'].split()[1]
         except:
             stuff = None