FUNCTION REFERENCE

hsv2rgb

Convert hue, saturation and value to red, green and blue.

Convert hue, saturation and value to red, green and blue.

Syntax

hsv2rgb(MAP); [R, G, B] = hsv2rgb(MAP); [R, G, B] = hsv2rgb(H, S, V)

A colormap is a double M-by-3 matrix. Three outputs return separate color channels. Three channel inputs must have equal sizes. A colormap value outside [0,1] is an error, as in MATLAB. An M-by-N-by-3 HSV image (double or single) gives an M-by-N-by-3 RGB image of the same class.

Example

hsv2rgb([0 1 1])   % [1 0 0]

Example

hsv2rgb(cat(3, 0, 1, 1))   % 1x1x3 [1 0 0]

Differences from MATLAB: the three-input single-output form is not supported yet.

These are the engine’s help pages. Each page keeps its compatibility notes. File operations are unavailable in the browser.