Color Gradient
   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 Commiss ...
, 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 Function or functionality may refer to: Computing * Function key, a type of key on computer keyboards * Function model, a structured representation of processes in a system * Function object or functor or functionoid, a concept of object-oriente ...
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 represent ...
C :f:
_, r_ The comma is a punctuation mark that appears in several variants in different languages. It has the same shape as an apostrophe or single closing quotation mark () in many typefaces, but it differs from them in being placed on the baseline ...
\subset \mathbf \to C which is defined by: * a colorspace C * an increasing sequence of sampling points r_0 < ... < r_m \in
_, r_ The comma is a punctuation mark that appears in several variants in different languages. It has the same shape as an apostrophe or single closing quotation mark () in many typefaces, but it differs from them in being placed on the baseline ...
/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 the intermediate values r_ < r < r_i \in
_, r_ The comma is a punctuation mark that appears in several variants in different languages. It has the same shape as an apostrophe or single closing quotation mark () in many typefaces, but it differs from them in being placed on the baseline ...
/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 real ...
r \in
_, r_ The comma is a punctuation mark that appears in several variants in different languages. It has the same shape as an apostrophe or single closing quotation mark () in many typefaces, but it differs from them in being placed on the baseline ...
\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 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 poin ...
, 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 ...
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, and t ...
, 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 const ...
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 (physics), reflection of light or other radiation, waves or particles from a surface such that a ray (optics), ray incident on the surface is scattering, scattered at many angles rather than at just one angle ...
of light from a point source by a
sphere A sphere () is a Geometry, geometrical object that is a solid geometry, three-dimensional analogue to a two-dimensional circle. A sphere is the Locus (mathematics), set of points that are all at the same distance from a given point in three ...
. 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 a ...
polygon mesh In 3D computer graphics and solid modeling, a polygon mesh is a collection of , s and s that defines the shape of a polyhedral object. The faces usually consist of triangles (triangle mesh), quadrilaterals (quads), or other simple convex polyg ...
es 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_\text = ...
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 co ...
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, ...
, 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 i ...
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 color scheme, palette is composed of one color (or lightness, values of one color). Images using only Tint, shade and tone, shades of grey are called grayscale (typically digital) or Black and wh ...
) 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 intensity, giving obvious visual cues to the reader about how the phenomenon is c ...
. 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) ''Bokashi'' (Japanese: ぼかし) is a technique used in Japanese woodblock printmaking. It achieves a variation in lightness and darkness (value) of a single color or multiple colors by hand applying a gradation of ink to a moistened wooden pri ...
*
Color banding Colour banding is a subtle form of posterization in digital images, caused by the colour of each pixel being rounded to the nearest of the digital colour levels. While posterization is often done for artistic effect, colour banding is an unde ...
*
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 transforms ...
; a function that maps (transforms) the colors of one image to the colors of another image *
Diffusion curve Diffusion curves are vector graphic primitives for creating smooth-shaded images. Each diffusion curve partitions the 2D graphics space through which it is drawn, defining different colors on either side. When rendered, these colors then spread i ...
*
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 *
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 ...
*
Ombré ''Ombré'' (literally "shaded" in French) is the blending of one color hue to another, usually moving tints and shades from light to dark. It has become a popular feature for hair coloring, nail art, and even baking, in addition to its uses in h ...
* Palette; 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 represent ...
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 A color chart or color reference card is a flat, physical object that has many different color samples present. They can be available as a single-page chart, or in the form of swatchbooks or color-matching fans. Typically there are two diffe ...


References

{{color topics Computer graphics