Brighten or darken colormap
brighten( shifts the
intensities of all colors in the current colormap in the same direction. The
colors brighten when
beta is between
1, and they darken when
0. The magnitude of the
change is proportional to the magnitude of
beta. Use this
syntax to adjust colors for all graphics objects in the current figure that use
returns the adjusted colormap for any of the input argument combinations in the
previous syntaxes. When you specify the output argument, the current figure is
newmap = brighten(___)
Create a surface plot with the default colormap.
Brighten the colormap for current figure.
Display two surface plots that use the
summer colormap in a tiled chart layout.
t = tiledlayout(1,2); ax1 = nexttile; surf(ax1,peaks); ax2 = nexttile; surf(ax2,peaks); colormap(summer)
summer colormap and apply it to the second surface.
newmap = brighten(summer,-.7); colormap(ax2,newmap)
beta— Brightness adjustment
Brightness adjustment parameter, specified as a numeric scalar value. The
brighten function raises each value in the colormap
to the power of γ, which is defined as:
Figure to adjust, specified as a
Figure object. When
you specify this argument, the colors of other graphics objects within the
figure are affected in addition to the objects that use the colormap. For
example, color of the axes, axes labels, and ticks changes.
Colormap to adjust, specified as a three-column matrix of RGB triplets. An RGB triplet is a three-element row vector whose elements specify the intensities of the red, green, and blue components of a color. The intensities must be in the range [0, 1]. For example, here is a colormap that contains five colors:
map = [0.2 0.1 0.5 0.1 0.5 0.8 0.2 0.7 0.6 0.8 0.7 0.3 0.9 1 0];
This table lists the RGB triplet values for common colors.
Alternatively, you can create the matrix by calling one of the predefined
colormap functions. Call the function as an input argument to the
brighten function. For example, this command
newmap— Adjusted colormap
Adjusted colormap, returned as a three-column matrix of RGB triplets.