【问题标题】:how can I show color of RGB triplet format in matlab?如何在 matlab 中显示 RGB 三元组格式的颜色?
【发布时间】:2016-07-29 08:18:14
【问题描述】:

我在 matlab 中有一个问题
我需要一个简单的 matlab 代码到 get (R,G,B) 并显示它的颜色。
例如get (1,0,0) 并显示red color。我该怎么办?

【问题讨论】:

  • 在下面查看我的答案。希望这对你有帮助..
  • 非常感谢。它的工作

标签: matlab image-processing rgb


【解决方案1】:

这里是例子

要将图形的背景颜色更改为绿色,请使用short namelong namean RGB triplet 指定颜色。这些语句产生相同的结果:

whitebg('g')
whitebg('green')
whitebg([0 1 0]);

您可以在需要定义颜色的任何地方使用 ColorSpec。例如,此语句将图形背景颜色更改为粉红色:

set(gcf,'Color',[1,0.4,0.6])

更多详情请访问http://in.mathworks.com/help/matlab/ref/colorspec.html?s_tid=gn_loc_drop

【讨论】:

  • @M.B 很高兴为您提供帮助。
猜你喜欢
  • 2017-02-24
  • 1970-01-01
  • 2012-04-03
  • 1970-01-01
  • 2020-11-25
  • 2021-12-14
  • 1970-01-01
  • 1970-01-01
  • 2018-03-19
相关资源
最近更新 更多