Main Content

colorcloud

Display 3-D color gamut as point cloud in specified color space

Description

colorcloud(rgb) displays the full color gamut of the color image rgb as a point cloud. By default, colorcloud uses the RGB color space.

colorcloud(rgb,colorspace) displays the full color gamut of the color image rgb as a point cloud in the color space specified by colorspace.

example

colorcloud(___,Name,Value) displays the full color gamut using name-value pairs to control aspects of the visualization.

hPanel = colorcloud(___) returns the uipanel object created by colorcloud.

Examples

collapse all

Read in RGB image.

RGB = imread('peppers.png');

View color gamut.

colorcloud(RGB,'hsv');

Figure contains an axes object and an object of type uipanel. The hidden axes object contains 11 objects of type scatter, line.

Input Arguments

collapse all

Color image, specified as an m-by-n-by-3 numeric array.

Data Types: single | double | uint8 | uint16

Color space name, specified as one of these values:

ValueDescription
'hsv'Color gamut in HSV color space
'lab'Color gamut in CIE 1976 L*a*b* color space
'rgb'Color gamut in RGB color space
'ycbcr'Color gamut in YCbCr color space

Data Types: char | string

Name-Value Arguments

collapse all

Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Before R2021a, use commas to separate each name and value, and enclose Name in quotes.

Example: 'BackgroundColor','w'

Parent of the object created by colorcloud, specified as a figure or uipanel object. If you do not specify a valid object, then the colorcloud function creates a new figure window.

Background color to the color cloud, specified as an RGB triplet, a color name, or a short color name.

You can specify any color using an RGB triplet. An RGB triplet is a 3-element row vector whose elements specify the intensities of the red, green, and blue components of the color. The intensities must be in the range [0, 1].

You can specify some common colors by name as a string scalar or character vector. This table lists the named color options and the equivalent RGB triplets.

Color NameShort NameRGB TripletAppearance
"red""r"[1 0 0]

Sample of the color red

"green""g"[0 1 0]

Sample of the color green

"blue""b"[0 0 1]

Sample of the color blue

"cyan" "c"[0 1 1]

Sample of the color cyan

"magenta""m"[1 0 1]

Sample of the color magenta

"yellow""y"[1 1 0]

Sample of the color yellow

"black""k"[0 0 0]

Sample of the color black

"white""w"[1 1 1]

Sample of the color white

This table lists the default color palettes for plots in the light and dark themes.

PalettePalette Colors

"gem" — Light theme default

Before R2025a: Most plots use these colors by default.

Sample of the "gem" color palette

"glow" — Dark theme default

Sample of the "glow" color palette

You can get the RGB triplets for these palettes using the orderedcolors function (since R2023b). For example, get the RGB triplets for the "gem" palette.

RGB = orderedcolors("gem");

Example: 'BackgroundColor','r'

Example: 'BackgroundColor','green'

Example: 'BackgroundColor',[0 0.4470 0.7410]

Color of the wire frame, specified as an RGB triplet, a color name, a short color name, or 'none'. If you specify the value 'none', then colorcloud deletes the wire frame.

You can specify any color using an RGB triplet. An RGB triplet is a 3-element row vector whose elements specify the intensities of the red, green, and blue components of the color. The intensities must be in the range [0, 1].

You can specify some common colors by name as a string scalar or character vector. This table lists the named color options and the equivalent RGB triplets.

Color NameShort NameRGB TripletAppearance
"red""r"[1 0 0]

Sample of the color red

"green""g"[0 1 0]

Sample of the color green

"blue""b"[0 0 1]

Sample of the color blue

"cyan" "c"[0 1 1]

Sample of the color cyan

"magenta""m"[1 0 1]

Sample of the color magenta

"yellow""y"[1 1 0]

Sample of the color yellow

"black""k"[0 0 0]

Sample of the color black

"white""w"[1 1 1]

Sample of the color white

This table lists the default color palettes for plots in the light and dark themes.

PalettePalette Colors

"gem" — Light theme default

Before R2025a: Most plots use these colors by default.

Sample of the "gem" color palette

"glow" — Dark theme default

Sample of the "glow" color palette

You can get the RGB triplets for these palettes using the orderedcolors function (since R2023b). For example, get the RGB triplets for the "gem" palette.

RGB = orderedcolors("gem");

Example: 'WireFrameColor','r'

Example: 'WireFrameColor','green'

Example: 'WireFrameColor',[0.8500 0.3250 0.0980]

Color of the orientation axes and labels, specified as an RGB triplet, a color name, a short color name, or 'none'. If you specify the value 'none', then colorcloud deletes the labels.

You can specify any color using an RGB triplet. An RGB triplet is a 3-element row vector whose elements specify the intensities of the red, green, and blue components of the color. The intensities must be in the range [0, 1].

You can specify some common colors by name as a string scalar or character vector. This table lists the named color options and the equivalent RGB triplets.

Color NameShort NameRGB TripletAppearance
"red""r"[1 0 0]

Sample of the color red

"green""g"[0 1 0]

Sample of the color green

"blue""b"[0 0 1]

Sample of the color blue

"cyan" "c"[0 1 1]

Sample of the color cyan

"magenta""m"[1 0 1]

Sample of the color magenta

"yellow""y"[1 1 0]

Sample of the color yellow

"black""k"[0 0 0]

Sample of the color black

"white""w"[1 1 1]

Sample of the color white

This table lists the default color palettes for plots in the light and dark themes.

PalettePalette Colors

"gem" — Light theme default

Before R2025a: Most plots use these colors by default.

Sample of the "gem" color palette

"glow" — Dark theme default

Sample of the "glow" color palette

You can get the RGB triplets for these palettes using the orderedcolors function (since R2023b). For example, get the RGB triplets for the "gem" palette.

RGB = orderedcolors("gem");

Example: 'OrientationAxesColor','r'

Example: 'OrientationAxesColor','green'

Example: 'OrientationAxesColor',[0.9290 0.6940 0.1250]

Output Arguments

collapse all

Color gamut point cloud, returned as a uipanel object.

Version History

Introduced in R2016b