term
authorVu Nhat Minh <vunhat_minh@dwango.co.jp>
Thu, 3 Jul 2014 08:34:47 +0000 (17:34 +0900)
committerVu Nhat Minh <vunhat_minh@dwango.co.jp>
Thu, 3 Jul 2014 08:34:47 +0000 (17:34 +0900)
rainbowstream/colors.py
rainbowstream/colorset/default.json
rainbowstream/colorset/monokai.json
rainbowstream/draw.py

index 159244d..95d34c3 100644 (file)
@@ -11,7 +11,7 @@ def basic_color(code):
     return inner
 
 
-def RGB(code):
+def term_color(code):
     """
     256 colors supported
     """
index 5938650..593321a 100644 (file)
@@ -40,7 +40,7 @@
         * light_magenta
         * light_cyan
         * white
-    and 256 colors from RGB_0 to RGB_255
+    and 256 colors from term_0 to term_255
     Color code can be reference at
     http://www.calmar.ws/vim/256-xterm-24bit-rgb-color-chart.html
      */
index a1ba750..06f508b 100644 (file)
         * light_magenta
         * light_cyan
         * white
-    and 256 colors from RGB_0 to RGB_255
-    Color code can be reference at
-    http://www.calmar.ws/vim/256-xterm-24bit-rgb-color-chart.html
-     */
+    and 256 terminal's colors from term_0 to term_255
+    */
 
-    "DECORATED_NAME" : "RGB_198",
-    "CYCLE_COLOR" :["RGB_198","RGB_57","RGB_166","RGB_50","RGB_179","RGB_74","RGB_112"],
+    "DECORATED_NAME" : "term_198",
+    "CYCLE_COLOR" :["term_198","term_57","term_166","term_50","term_179","term_74","term_112"],
     "TWEET" : {
-        "nick"      : "RGB_112",
-        "clock"     : "RGB_57",
-        "id"        : "RGB_166",
-        "favourite" : "RGB_50",
-        "rt"        : "RGB_179",
-        "link"      : "RGB_74",
+        "nick"      : "term_112",
+        "clock"     : "term_57",
+        "id"        : "term_166",
+        "favourite" : "term_50",
+        "rt"        : "term_179",
+        "link"      : "term_74",
         "keyword"   : "on_light_green"
     },
 
     "MESSAGE" : {
-        "sender"    : "RGB_112",
-        "recipient" : "RGB_112",
-        "to"        : "RGB_50",
-        "clock"     : "RGB_57",
-        "id"        : "RGB_166"
+        "sender"    : "term_112",
+        "recipient" : "term_112",
+        "to"        : "term_50",
+        "clock"     : "term_57",
+        "id"        : "term_166"
     },
 
     "PROFILE" : {
-        "statuses_count"    : "RGB_112",
-        "friends_count"     : "RGB_198",
-        "followers_count"   : "RGB_57",
-        "nick"              : "RGB_198",
-        "profile_image_url" : "RGB_74",
-        "description"       : "RGB_166",
-        "location"          : "RGB_112",
-        "url"               : "RGB_74",
-        "clock"             : "RGB_57"
+        "statuses_count"    : "term_112",
+        "friends_count"     : "term_198",
+        "followers_count"   : "term_57",
+        "nick"              : "term_198",
+        "profile_image_url" : "term_74",
+        "description"       : "term_166",
+        "location"          : "term_112",
+        "url"               : "term_74",
+        "clock"             : "term_57"
     },
 
     "TREND" : {
-        "url": "RGB_74"
+        "url": "term_74"
     }
 }
\ No newline at end of file
index a44450c..d25a3c9 100644 (file)
@@ -24,8 +24,8 @@ def init_cycle():
     Init the cycle
     """
     colors_shuffle = [globals()[i.encode('utf8')]
-        if not i.startswith('RGB_')
-        else RGB(int(i[4:]))
+        if not i.startswith('term_')
+        else term_color(int(i[4:]))
         for i in c['CYCLE_COLOR']]
     return itertools.cycle(colors_shuffle)
 g['cyc'] = init_cycle()
@@ -109,8 +109,8 @@ def color_func(func_name):
     Call color function base on name
     """
     pure = func_name.encode('utf8')
-    if pure.startswith('RGB_') and pure[4:].isdigit():
-        return RGB(int(pure[4:]))
+    if pure.startswith('term_') and pure[4:].isdigit():
+        return term_color(int(pure[4:]))
     return globals()[pure]