配色方案

参考:
https://zhuanlan.zhihu.com/p/546788908?share_code=UOfQzlWp5gzU&utm_psn=1906364628998555376
https://zhuanlan.zhihu.com/p/593320758

00

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
% 定义 plan00 
colors(1).name = 'red';
colors(1).rgb = [219, 049, 036] / 255;
colors(2).name = 'orange';
colors(2).rgb = [252, 140, 090] / 255;
colors(3).name = 'yellow';
colors(3).rgb = [255, 223, 146] / 255;
colors(4).name = 'bg-blue';
colors(4).rgb = [230, 241, 243] / 255;
colors(5).name = 'light-blue';
colors(5).rgb = [144, 190, 224] / 255;
colors(6).name = 'deep-blue';
colors(6).rgb = [075, 116, 178] / 255;
% 将颜色数据保存到文件
save('plan00.mat', 'colors');

01

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
% 定义 plan01
colors(1).name = 'dark-green';
colors(1).rgb = [038, 070, 083] / 255;
colors(2).name = 'deep-green';
colors(2).rgb = [040, 114, 113] / 255;
colors(3).name = 'bi-green';
colors(3).rgb = [042, 157, 140] / 255;
colors(4).name = 'light-green';
colors(4).rgb = [138, 176, 125] / 255;
colors(5).name = 'bg-green';
colors(5).rgb = [236, 240, 219] / 255;
colors(6).name = 'deep-blue';
colors(6).rgb = [075, 116, 178] / 255;
% 将颜色数据保存到文件
save('plan01.mat', 'colors');

02

1
2
3
4
5
6
7
8
9
% 定义 plan02
colors(1).name = 'dark-red';
colors(1).rgb = [120, 000, 001] / 255;
colors(2).name = 'dark-blue';
colors(2).rgb = [000, 047, 073] / 255;
colors(3).name = 'bg-yellow';
colors(3).rgb = [254, 240, 213] / 255;
% 将颜色数据保存到文件
save('plan03.mat', 'colors');

效果展示

参考文章: https://dxs.moe.gov.cn/zx/a/hd_sxjm_sxjmlw_2024qgdxssxjmjslwzs_2024ctlw/241104/1977952.shtml

05

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
% 定义 RGB 颜色数据和名称
colors(1).name = 'blue-green';
colors(1).rgb = [68, 117, 122] / 255;
colors(2).name = 'green-gray';
colors(2).rgb = [183, 181, 160] / 255;
colors(3).name = 'red';
colors(3).rgb = [212, 076, 060] / 255;
colors(4).name = 'deep-purple';
colors(4).rgb = [69, 42, 61] / 255;
colors(5).name = 'skin';
colors(5).rgb = [238, 213, 183] / 255;
colors(6).name = 'light-yellow';
colors(6).rgb = [252, 231, 186] / 255;
colors(7).name = 'brown';
colors(7).rgb = [203, 153, 126] / 255;
% 将颜色数据保存到文件
save('colors.mat', 'colors');

引用示例

1
2
3
4
5
6
7
8
9
10
11
12
13
load('colors.mat');
x = 1:7; % x 轴数据
y = rand(1, 7); % y 轴数据,随机生成
figure;
hold on;
for i = 1:length(colors)
% 使用结构体中的 RGB 值设置颜色
bar(x(i), y(i), 'FaceColor', colors(i).rgb);
end
xlabel('颜色编号');
ylabel('随机值');
title('使用自定义颜色绘制的条形图');
hold off;

色卡

效果展示

参考文章: https://dxs.moe.gov.cn/zx/a/hd_sxjm_sxjmlw_2024qgdxssxjmjslwzs_2024ctlw/241104/1977952.shtml