brighten

Makes a colormap brighter or darker.

Category: Graphics > Formatting and Annotation

Syntax

brighten(beta)

Changes the current colormap.

newmap = brighten(map, beta)

Returns a modified copy of map.

brighten(fig, beta)

Changes the colormap of a figure.

Description

The colors are moved by a power-law curve, so black and white stay fixed while the mid-tones shift. Repeated calls compound the change.

Input arguments

map
Colormap matrix.
beta
Number in the open range from -1 to 1. Positive values brighten, negative values darken. Values near 1 or -1 are extreme.

Output arguments

newmap
Adjusted colormap with the same size as map.

Example

Brightening a gray map

c = brighten(gray(3), 0.5)
Output
c = 3×3

         0         0         0
    0.7071    0.7071    0.7071
    1.0000    1.0000    1.0000

See also

colormap contrast gray