如何将常规背景颜色从黑色更改为蓝色 [英] How do I change my regular background colour from black to, let's say blue

查看:151
本文介绍了如何将常规背景颜色从黑色更改为蓝色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用代码块,我只是设计了一个迷你游戏,但我也希望背景是我的选择。如何改变这个系统(cls);从黑色到蓝色



我尝试过:



我不知道该怎么办。我不知道现在该做什么,或从哪里开始。

I'm using code blocks, i just designed a mini game but i also want the background to be of my choice. How do a change this system ("cls"); from black to a blue colour

What I have tried:

I don't know what to do. I don't know what to do now, or where to start from.

推荐答案

使用cls表示您的应用程序在控制台上运行(shell,命令提示)。然后你可以使用 ANSI转义码 - 维基百科 [ ^ ](取决于操作系统系统)。有关设置背景颜色的代码,请参阅上面的链接和终端 - ANSI颜色转义列表序列 - 堆栈溢出 [ ^ ]。



要选择蓝色背景,可以是例如

Using "cls" indicates that your application is running at a console (shell, command prompt). Then you can use the ANSI escape code - Wikipedia[^] supported by the console (which depends on the operating system system). For the codes to set the background colour see the above link and terminal - List of ANSI color escape sequences - Stack Overflow[^].

To select blue background, it could be for example
printf("\033[48;2;0;0;255m");



注意:

如果您使用的是Windows,则需要Windows 10(1511)。较旧的Windows版本不支持控制台上的ANSI转义序列。


Note:
If you are using Windows, you need Windows 10 (1511). Older Windows versions did not support ANSI escape sequences on the console.


先生,我使用了代码块。界面只显示常规的黑色背景。我只是想把我的作品着色。
Sir, i used codeblocks. The interface is just displaying the regular black background. I'm just trying to colourize my work.


这篇关于如何将常规背景颜色从黑色更改为蓝色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆