Why does Matlab R2013b display backgroundcolor in RGB format ?

I am using MATLAB 2013b .I set the background color of a block by : right clicking on the block>> Format>> Backgroundcolor>>Green. But when I try to get the color of the block from the command window, it gives the color in RGB format and not as green .
>>get_param(gcbh,'Backgroundcolor')
ans= [0.000000, 0.819608, 0.000000]
Now I color another block and try to get the color property
>> get_param(gcbh,'BackgroundColor')
ans =
green
Could you please explain why there is a difference and how could I solve this ?

Answers (1)

All we know about the difference between the 2 examples is that you color "a block" at first and "another block" at second.
Please provide more information, e.g. if the order matters or if you are talking of different blocks. The Matlab and OS version might be useful also.
Please explain also, why the observed effect is a problem, because currently it is hard to suggest a workaround, when it is not clear, why your work is impeded by this detail.

1 Comment

I have already mentioned the matlab version R2013b .OS is Windows 7. There is no pattern as such to color the blocks . My purpose is to check if the color of the block is green . If not I want to throw an error message . But when I try to get the color property it shows RGB format and I get the error message any way even if it is green . Below is the code :
blockcolor= get_param(<block>,'backgroundcolor');
if ~strcmp(blockcolor,'green')
disp(' Block color is not green');
end

Sign in to comment.

Categories

Products

Asked:

on 12 Mar 2015

Commented:

on 12 Mar 2015

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!