HOME

TheInfoList



OR:

In
color science Color science is the scientific study of color including lighting and optics; measurement of light and color; the physiology, psychophysics, and modeling of color vision; and color reproduction. History Organizations * International Com ...
, a color gradient specifies a range of position-dependent
color Color (American English) or colour (British English) is the visual perceptual property deriving from the spectrum of light interacting with the photoreceptor cells of the eyes. Color categories and physical specifications of color are associ ...
s, usually used to fill a region.


Name

A color gradient is also known as a color ramp or a color progression. In assigning colors to a set of values, a gradient is a continuous colormap, a type of
color scheme In color theory, a color scheme is the choice of colors used in various artistic and design contexts. For example, the "Achromatic" use of a white background with black text is an example of a basic and commonly default color scheme in web de ...
.


Definitions

* Color gradient is a set of colors arranged in a
linear order In mathematics, a total or linear order is a partial order in which any two elements are comparable. That is, a total order is a binary relation \leq on some set X, which satisfies the following for all a, b and c in X: # a \leq a ( reflexive) ...
( ordered) * A continuous colormap is a curve through a
colorspace A color space is a specific organization of colors. In combination with color profiling supported by various physical devices, it supports reproducible representations of colorwhether such representation entails an analog or a digital represen ...
3D RGB profile of the Linear Gray Continous color gradient.png, gray 3D RGB profile of cubehelix color gradient.png, cubehelix 0 3d 60 75 v.png, HSV rainbow 3D RGB profile of the Smooth Cool Warm diverging color gradient by Kenneth Moreland.png, diverging


Strict definition

A colormap is a function which associate a real value r with point c in
color space A color space is a specific organization of colors. In combination with color profiling supported by various physical devices, it supports reproducible representations of colorwhether such representation entails an analog or a digital represen ...
C :f: _, r_\subset \mathbf \to C which is defined by: * a colorspace C * an increasing sequence of sampling points r_0 < ... < r_m \in _, r_/math> * a series of values in the colorspace c_0,..., c_m \in C * the mapping f(r_i) = c_i ,i = 0,...,m * a rule for
interpolating In the mathematics, mathematical field of numerical analysis, interpolation is a type of estimation, a method of constructing (finding) new data points based on the range of a discrete set of known data points. In engineering and science, one ...
the intermediate values r_ < r < r_i \in _, r_/math> where: * r is a
real number In mathematics, a real number is a number that can be used to measure a ''continuous'' one-dimensional quantity such as a distance, duration or temperature. Here, ''continuous'' means that values can have arbitrarily small variations. Every ...
r \in _, r_\subset \mathbf * \mathbf is a set of real numbers * c is a
color Color (American English) or colour (British English) is the visual perceptual property deriving from the spectrum of light interacting with the photoreceptor cells of the eyes. Color categories and physical specifications of color are associ ...
= point in
colorspace A color space is a specific organization of colors. In combination with color profiling supported by various physical devices, it supports reproducible representations of colorwhether such representation entails an analog or a digital represen ...
C


Types

Criteria for classification: * dimension * discrete ( clasessed ) / continuous * shape * range: full or limited. Example :
pastel color Pastels or pastel colors belong to a pale family of colors, which, when described in the HSV color space, have high value and low saturation. They are named after an artistic medium made from pigment and solid binding agents, similar to cr ...
with limited range of saturation. * perceptual uniformity * order ** ordered (sequential) and non-ordered (categorical) ** perceptual order * readability for color-vision deficient or color-blind people ( colorblind-friendly) * color space


Dimension

* 1D * 2D * 3D


Shapes


Axial gradients

An axial color gradient (sometimes also called a linear color gradient) is specified by two points, and a color at each point. The colors along the line through those points are calculated using
linear interpolation In mathematics, linear interpolation is a method of curve fitting using linear polynomials to construct new data points within the range of a discrete set of known data points. Linear interpolation between two known points If the two known poi ...
, then extended perpendicular to that line. In
digital imaging Digital imaging or digital image acquisition is the creation of a digital representation of the visual characteristics of an object, such as a physical scene or the interior structure of an object. The term is often assumed to imply or include t ...
systems, colors are typically interpolated in an
RGB color space An RGB color space is any additive color space based on the RGB color model. An RGB color space is defined by chromaticity coordinates of the red, green, and blue additive primaries, the white point which is usually a standard illuminant, an ...
, often using gamma compressed RGB color values, as opposed to linear. CSS and SVG both support linear gradients.


Radial gradients

A radial gradient is specified as a
circle A circle is a shape consisting of all points in a plane that are at a given distance from a given point, the centre. Equivalently, it is the curve traced out by a point that moves in a plane so that its distance from a given point is cons ...
that has one color at the edge and another at the center. Colors are calculated by linear interpolation based on distance from the center. This can be used to approximate the
diffuse reflection Diffuse reflection is the reflection of light or other waves or particles from a surface such that a ray incident on the surface is scattered at many angles rather than at just one angle as in the case of specular reflection. An ''ideal'' ...
of light from a point source by a
sphere A sphere () is a geometrical object that is a three-dimensional analogue to a two-dimensional circle. A sphere is the set of points that are all at the same distance from a given point in three-dimensional space.. That given point is the c ...
. Both CSS and SVG support radial gradients.


Conic gradients

Conic or conical gradients are gradients with color transitions rotated around a center point (rather than radiating from the center). Example conic gradients include pie charts and color wheels.


Other shapes

In
vector graphics Vector graphics is a form of computer graphics in which visual images are created directly from geometric shapes defined on a Cartesian plane, such as points, lines, curves and polygons. The associated mechanisms may include vector display ...
polygon meshes can be used, e.g.,
Adobe Illustrator Adobe Illustrator is a vector graphics editor and design program developed and marketed by Adobe Inc. Originally designed for the Apple Macintosh, development of Adobe Illustrator began in 1985. Along with Creative Cloud (Adobe's shift to month ...
supported ''gradient meshes''.


color space

LCH Gradient Example.png, LCH HSV Gradient Example.png, HSV


Effect of color space

The appearance of a gradient not only varies by the color themselves, but also by the color space the calculation is performed in. The problem usually becomes important for two reasons: *
Gamma correction Gamma correction or gamma is a nonlinear operation used to encode and decode luminance or tristimulus values in video or still image systems. Gamma correction is, in the simplest cases, defined by the following power-law expression: : V_\tex ...
to a color space. With a typical γ of around 2, it is easy to see that a gamma-enabled color space will blend darker than a linear-intensity color space, since the sum of squares of two numbers is never more than the square of their sum. The effect is most apparent in blending
complementary colors Complementary colors are pairs of colors which, when combined or mixed, cancel each other out (lose hue) by producing a grayscale color like white or black. When placed next to each other, they create the strongest contrast for those two c ...
like red and green, with the middle color being a dark color instead of the expected yellow. The radial and conic examples on this page clearly exhibit this error. * Handling of other perceptual properties. In
information visualization Information is an abstract concept that refers to that which has the power to inform. At the most fundamental level information pertains to the interpretation of that which may be sensed. Any natural process that is not completely random, a ...
, it is undesirable to have a supposedly "flat" gradient show non-monotonic variations in lightness and saturation along the way. This is because human vision emphasizes these qualities, causing bias or confusion in interpretation. A "linear" blend would match physical light blending and has been the standard in
game engine A game engine is a software framework primarily designed for the development of video games and generally includes relevant libraries and support programs. The "engine" terminology is similar to the term "software engine" used in the software ...
s for a long time. On the web, however, it has long been neglected for both color gradients and image scaling. Such a blend still has a subtle difference from one done in a perceptually-uniform color space.


Examples

Cubehelix gnuplot palette.png Gnuplot color gradient, defined as 0 0 0 0, 1 0 0 1, 3 0 1 0, 4 1 0 0, 6 1 1 1.png P hot inv.gif P hot.gif Gnuplot color gradient RGB defined ( 0 "red", 0.5 "yellow", 1 "green" ).png Matlab gradient.png Gnuplot HSV gradient.png Mono1.png, Single hue (
monochromatic A monochrome or monochromatic image, object or palette is composed of one color (or values of one color). Images using only shades of grey are called grayscale (typically digital) or black-and-white (typically analog). In physics, monochro ...
) gradient Le Jeu Analogue.png, polychromatic ( multi hue ) color gradient


HSV rainbow

Gnuplot HSV gradient.png, RGB 2D profiles HSV 2D profile of the rainbow gradient.png, HSV 2D profiles 0 3d 60 75 v.png, 3D RGB profile


Applications

* represent quantitative or ordinal values, like in
heat maps A heat map (or heatmap) is a data visualization technique that shows magnitude of a phenomenon as color in two dimensions. The variation in color may be by hue or brightness, intensity, giving obvious visual cues to the reader about how the pheno ...
. More precise description is in color box. * fill a region: many
window managers A window manager is system software that controls the placement and appearance of windows within a windowing system in a graphical user interface. Most window managers are designed to help provide a desktop environment. They work in conjunction ...
allow the screen background to be specified as a gradient. The colors produced by a gradient vary continuously with position, producing smooth color transitions. * visualize the progression of an extended computer operation, such as a download, file transfer, or installation. See
progress bar ...


Weblinks


See also

* Bokashi (printing) * Color banding *
Color difference In color science, color difference or color distance is the separation between two colors. This metric allows quantified examination of a notion that formerly could only be described with adjectives. Quantification of these properties is of great ...
*
Color mapping Color mapping is a function that maps (transforms) the colors of one (source) image to the colors of another (target) image. A color mapping may be referred to as the algorithm that results in the mapping function or the algorithm that transfor ...
; a function that maps (transforms) the colors of one image to the colors of another image * Diffusion curve *
dithering Dither is an intentionally applied form of noise used to randomize quantization error, preventing large-scale patterns such as color banding in images. Dither is routinely used in processing of both digital audio and video data, and is often ...
*
Image gradient An image gradient is a directional change in the intensity or color in an image. The gradient of the image is one of the fundamental building blocks in image processing. For example, the Canny edge detector uses image gradient for edge detectio ...
*
Mach banding Mach bands is an optical illusion named after the physicist Ernst Mach. It exaggerates the contrast between edges of the slightly differing shades of gray, as soon as they contact one another, by triggering edge-detection in the human visual s ...
* Ombré *
Palette Palette may refer to: * Cosmetic palette, an archaeological form * Palette, another name for a color scheme * Palette (painting), a wooden board used for mixing colors for a painting ** Palette knife, an implement for painting * Palette (company) ...
; a finite set of colors in no particular order *
Perceptually uniform In color science, color difference or color distance is the separation between two colors. This metric allows quantified examination of a notion that formerly could only be described with adjectives. Quantification of these properties is of great ...
color space A color space is a specific organization of colors. In combination with color profiling supported by various physical devices, it supports reproducible representations of colorwhether such representation entails an analog or a digital represen ...
s *
Posterization Posterization or posterisation of an image is the conversion of a continuous gradation of tone to several regions of fewer tones, causing abrupt changes from one tone to another. This was originally done with photographic processes to create p ...
* Color chart


References

{{color topics Computer graphics