Commits

Yasuhiro Matsumoto committed d631221

エスケープシーケンス39/49番に対応。

  • Participants
  • Parent commits 8fb0900

Comments (0)

Files changed (3)

 }
 
 
+int Console::foremask(int n)
+{
+    return n & (
+	FOREGROUND_RED
+	|FOREGROUND_BLUE
+	|FOREGROUND_GREEN
+	|FOREGROUND_INTENSITY);
+}
+
+
+int Console::backmask(int n)
+{
+    return n & (
+	BACKGROUND_RED
+	|BACKGROUND_BLUE
+	|BACKGROUND_GREEN
+	|BACKGROUND_INTENSITY);
+}
+
+
 int Console::color()
 {
     if (hStdout == (HANDLE )-1L)
     static void getLocate(int &x,int &y);
     static void color(int c);
     static int color();
+    static int foremask(int n);
+    static int backmask(int n);
     static int getWidth();
 #endif
     /* enum{ SHIFT = 0x3 }; */
 
 		    if( 30 <= param[i] && param[i] <= 37 ){
 			forecolor = cnv[ param[i]-30 ];
+		    }else if( param[i] == 39 ){
+			forecolor = Console::foremask(default_color);
 		    }else if( 40 <= param[i] && param[i] <= 47 ){
 			backcolor = cnv[ param[i]-40 ];
+		    }else if( param[i] == 49 ){
+			backcolor = Console::backmask(default_color);
 		    }else if( param[i] == 1 ){
 			high = 1;
 		    }else if( param[i] == 0 ){