#!/usr/bin/env python
# -*- coding: utf-8 -*-


def color(color):
    from core import compatible
    os_name = compatible.os_name()
    if 'linux' in os_name or os_name == 'darwin':
        if color == 'reset':
            return '\033[0m'
        if color == 'grey':
            return '\033[1;30m'
        if color == 'red':
            return '\033[1;31m'
        if color == 'green':
            return '\033[1;32m'
        if color == 'yellow':
            return '\033[1;33m'
        if color == 'blue':
            return '\033[1;34m'
        if color == 'purple':
            return '\033[1;35m'
        if color == 'cyan':
            return '\033[1;36m'
        if color == 'white':
            return '\033[1;37m'
    else:
        return ''
    ''' Add in next versions!
		import ctypes
		std_out_handle = ctypes.windll.kernel32.GetStdHandle(-11)
		handle=std_out_handle
		if color == 'reset':
			pass
		if color == 'grey':
			ctypes.windll.kernel32.SetConsoleTextAttribute(handle, 0x07)
		if color == 'red':
			ctypes.windll.kernel32.SetConsoleTextAttribute(handle, 12)
		if color == 'green':
			ctypes.windll.kernel32.SetConsoleTextAttribute(handle, 10)
		if color == 'yellow':
			ctypes.windll.kernel32.SetConsoleTextAttribute(handle, 0x06)
		if color == 'blue':
			ctypes.windll.kernel32.SetConsoleTextAttribute(handle, 0x09)
		if color == 'purple':
			ctypes.windll.kernel32.SetConsoleTextAttribute(handle, 13)
		if color == 'cyan':
			ctypes.windll.kernel32.SetConsoleTextAttribute(handle, 11)
		if color == 'white':
			ctypes.windll.kernel32.SetConsoleTextAttribute(handle, 0x07)

	'''

@@ -43,94 +43,392 @@
 -*-%0A
-%0A%0Adef color(color):%0A    from core import compatible%0A    os_name = compatible.os_name()
+import sys%0Afrom core import compatible%0A%0Aos_name = compatible.os_name()%0A%0A%0Adef finish():%0A    if 'linux' in os_name or os_name == 'darwin':%0A        sys.std.write('%5C033%5B0m')%0A    else:%0A        import ctypes%0A        std_out_handle = ctypes.windll.kernel32.GetStdHandle(-11)%0A        handle = std_out_handle%0A        ctypes.windll.kernel32.SetConsoleTextAttribute(handle, 7)%0A%0Adef color(color):
 %0A   
@@ -1039,50 +1039,8 @@
     
-return ''%0A    ''' Add in next versions!%0A%09%09
 impo
@@ -1049,18 +1049,24 @@
  ctypes%0A
-%09%09
+        
 std_out_
@@ -1119,17 +1119,25 @@
 11)%0A
-%09%09
+        
 handle
-=
+ = 
 std_
@@ -1147,18 +1147,24 @@
 _handle%0A
-%09%09
+        
 if color
@@ -1180,18 +1180,33 @@
 t':%0A
-%09%09%09pass%0A%09%09
+            pass%0A        
 if c
@@ -1221,19 +1221,28 @@
 'grey':%0A
-%09%09%09
+            
 ctypes.w
@@ -1294,18 +1294,24 @@
 , 0x07)%0A
-%09%09
+        
 if color
@@ -1321,19 +1321,28 @@
  'red':%0A
-%09%09%09
+            
 ctypes.w
@@ -1392,18 +1392,24 @@
 le, 12)%0A
-%09%09
+        
 if color
@@ -1417,27 +1417,36 @@
 == 'green':%0A
-%09%09%09
+            
 ctypes.windl
@@ -1492,18 +1492,24 @@
 le, 10)%0A
-%09%09
+        
 if color
@@ -1522,19 +1522,28 @@
 ellow':%0A
-%09%09%09
+            
 ctypes.w
@@ -1595,18 +1595,24 @@
 , 0x06)%0A
-%09%09
+        
 if color
@@ -1619,27 +1619,36 @@
  == 'blue':%0A
-%09%09%09
+            
 ctypes.windl
@@ -1696,18 +1696,24 @@
 , 0x09)%0A
-%09%09
+        
 if color
@@ -1722,27 +1722,36 @@
 = 'purple':%0A
-%09%09%09
+            
 ctypes.windl
@@ -1797,18 +1797,24 @@
 le, 13)%0A
-%09%09
+        
 if color
@@ -1825,19 +1825,28 @@
 'cyan':%0A
-%09%09%09
+            
 ctypes.w
@@ -1896,18 +1896,24 @@
 le, 11)%0A
-%09%09
+        
 if color
@@ -1929,11 +1929,20 @@
 e':%0A
-%09%09%09
+            
 ctyp
@@ -2002,10 +2002,18 @@
 07)%0A
-%0A%09'
+    return 
 ''%0A

active color feature on windows