[oeasy]python0078_设置索引颜色_index_color_ansi_控制终端颜色
简介:
[oeasy]python0078_设置索引颜色_index_color_ansi_控制终端颜色
更多颜色
回忆上次内容
- 91-97 是 高亮 前景色
- 101-107是 高亮 背景色

更多颜色

索引颜色表

规则原理


- r、g、b 都是从 {0,1,2,3,4,5} 的阶梯范围
- 具体的颜色数值
lolcat

海蓝色的大海龟


循环范围

修改



设置前景 为 索引颜色


设置背景 为 索引颜色


- 能否 让这些字 一个个出来 呢?
- 逐个出现 肯定要用到 延迟
一个个出来


设置

- 16 + 231 = 247
- 17 + 230 = 247
- 18 + 229 = 247
利用规律


总结
- \33[38;5;XXXm 设置 前景为索引色
- \33[48;5;XXXm 设置 背景为索引色

- 有可能吗??🤔
- 我们下次再说!👋
- 蓝桥->https://www.lanqiao.cn/courses/3584
- github->https://github.com/overmind1980/oeasy-python-tutorial
- gitee->https://gitee.com/overmind1980/oeasypython
- 视频->https://www.bilibili.com/video/BV1CU4y1Z7gQ 作者:oeasy