Quellcode durchsuchen

add light colors

Yasuhiro Matsumoto vor 10 Jahren
Ursprung
Commit
3dac7b4f76
1 geänderte Dateien mit 24 neuen und 0 gelöschten Zeilen
  1. 24 0
      colorable_windows.go

+ 24 - 0
colorable_windows.go

@@ -471,6 +471,30 @@ loop:
 					case n == 49: // reset foreground color.
 						attr &= foregroundMask
 						attr |= w.oldattr & backgroundMask
+					case 90 <= n && n <= 97:
+						attr = (attr & backgroundMask)
+						attr |= foregroundIntensity
+						if (n-90)&1 != 0 {
+							attr |= foregroundRed
+						}
+						if (n-90)&2 != 0 {
+							attr |= foregroundGreen
+						}
+						if (n-90)&4 != 0 {
+							attr |= foregroundBlue
+						}
+					case 100 <= n && n <= 107:
+						attr = (attr & foregroundMask)
+						attr |= backgroundIntensity
+						if (n-100)&1 != 0 {
+							attr |= backgroundRed
+						}
+						if (n-100)&2 != 0 {
+							attr |= backgroundGreen
+						}
+						if (n-100)&4 != 0 {
+							attr |= backgroundBlue
+						}
 					}
 					procSetConsoleTextAttribute.Call(uintptr(w.handle), uintptr(attr))
 				}