精華區beta HP_86_310 關於我們 聯絡資訊
控制碼 (一) --- 屬性種類 彩色控制碼的原理是由 dos 中的 ansi.sys 的原理來的!! 其中 彩色控制碼共可簡單的分成三個部份: 一、文字屬性: Text attributes 0 正常屬性 ( All attributes off ) 1 高亮度 ( Bold on ) 4 底線模式 ( Underscore ) (視模擬器而定) 5 閃爍 ( Blink on ) 7 反相 ( Reverse video on ) 二、文字顏色: (又稱為前景顏色) Foreground colors 30 Black 31 Red 32 Green 33 Yellow 34 Blue 35 Magenta 36 Cyan 37 White 三、背景顏色: (又稱為背景顏色) Background colors 40 Black 41 Red 42 Green 43 Yellow 44 Blue 45 Magenta 46 Cyan 47 White 其中可以比較方便記憶的是,文字屬性都只是個位數字的,而前 景顏色是由 30 到 37;而背景顏色是由 40 到 47。所以我們只需要 記其個位數就行了!!