c 調整介面字型顏色

2021-09-01 11:59:32 字數 3045 閱讀 2256

需要引入標頭檔案:

#include

一、改變整個控制台的顏色

用 system("color 0a"); 

其中color後面的0是背景色代號,a是前景色代號。各顏色**如下: 

0 = 黑色 

1 = 藍色 

2 = 綠色 

3 = 湖藍色 

4 = 紅色 

5 = 紫色 

6 = 黃色 

7 = 白色 

8 = 灰色 

9 = 淡藍色 

a = 淡綠色 

b = 淡淺綠色 

c = 淡紅色 

d = 淡紫色 

e = 淡黃色 

f = 亮白色

二、改變下乙個輸出或者輸入字型和背景的顏色採用setconsoletextattribute函式,如

white on black:

setconsoletextattribute(getstdhandle(std_output_handle),foreground_intensity |

foreground_red | foreground_green | foreground_blue);

red on black:

setconsoletextattribute(getstdhandle(std_output_handle),foreground_intensity |

foreground_red);

green on black:

setconsoletextattribute(getstdhandle(std_output_handle),foreground_intensity |

foreground_green);

yellow on black:

setconsoletextattribute(getstdhandle(std_output_handle),foreground_intensity |

foreground_red | foreground_green);

blue on black:

setconsoletextattribute(getstdhandle(std_output_handle),foreground_intensity |

foreground_blue);

magenta on black:

setconsoletextattribute(getstdhandle(std_output_handle),foreground_intensity |

foreground_red | foreground_blue);

cyan on black:

setconsoletextattribute(getstdhandle(std_output_handle),foreground_intensity |

foreground_green | foreground_blue);

black on gray:

setconsoletextattribute(getstdhandle(std_output_handle),background_intensity |

background_intensity);

black on white:

setconsoletextattribute(getstdhandle(std_output_handle),background_intensity |

foreground_intensity | background_red | background_green | background_blue);

red on white:

setconsoletextattribute(getstdhandle(std_output_handle),background_intensity |

foreground_intensity | background_red | background_green | background_blue |

foreground_red);

函式原型:

bool setconsoletextattribute( handle hconsoleoutput, word wattributes ); 

wattributes 的取值含義對應如下:

attribute meaning :

foreground_blue text color contains blue. 

foreground_green text color contains green. 

foreground_red text color contains red. 

foreground_intensity text color is intensified. 

background_blue background color contains blue. 

background_green background color contains green. 

background_red background color contains red. 

background_intensity background color is intensified. 

common_lvb_leading_byte leading byte. 

common_lvb_trailing_byte trailing byte. 

common_lvb_grid_horizontal top horizontal. 

common_lvb_grid_lvertical left vertical. 

common_lvb_grid_rvertical right vertical. 

common_lvb_reverse_video reverse foreground and background attributes. 

common_lvb_underscore underscore

Jmeter介面字型調整

在jmeter安裝目錄下,找到 x apache jmeter 5.0 bin下的jmeter.properties檔案,將其進行修改即可。修改好此檔案之後,需要重啟jmeter後當前的修改才生效。調整空白區域的字型 jsyntaxtextarea.font.family hack jsyntaxt...

C中字型顏色

1.改變整個控制台的顏色 用 system color 0a 其中color後面的0是背景色代號,a是前景色代號。各顏色 如下 0 黑色 1 藍色 2 綠色 3 湖藍色 4 紅色 5 紫色 6 黃色 7 白色 8 灰色 9 淡藍色 a 淡綠色 b 淡淺綠色 c 淡紅色 d 淡紫色 e 淡黃色 f 亮...

python詞云調整字型顏色方法

配合上次的詞云 用colormap string or matplotlib colormap,default viridis 給每個單詞隨機分配顏色,若指定color func,則忽略該方法。不會用color func方法,所以就找到乙個這種方法 import matplotlib.pyplot ...