I have [H,S,V] colour values.
How can I convert them to [R,G,B] in MATLAB?
I've tried with the algorithm but I'm having some problems. Can anyone help me with the code?
I have [H,S,V] colour values.
How can I convert them to [R,G,B] in MATLAB?
I've tried with the algorithm but I'm having some problems. Can anyone help me with the code?
Using the in-built
hsv2rgb
function...Putting all of this together, we can simply do
Testing this using Google's color picker, we can see this is the correct solution. If you wanted to do any other RGB manipulation within MATLAB then leave the values in the range (0-1), since that is what MATLAB always uses.
If you have many HSV values, store them in an
mx3
matrix, with columns H,S and V. Then similarly to the above you can do: