Color gradient
In color science, a color gradient specifies a range of position-dependent colors, 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 computer graphics, the term swatch has come to mean a palette of active colors.
Definitions
- Color gradient is a set of colors arranged in a linear order ( ordered)
- A continuous colormap is a curve through a colorspace
Strict definition
A colormap^{[3]} is a function which associate a real value r with point c in color space [math]\displaystyle{ C }[/math]
- [math]\displaystyle{ f: [r_{min}, r_{max}] \subset \mathbf{R} \to C }[/math]
which is defined by:
- a colorspace C
- an increasing sequence of sampling points [math]\displaystyle{ r_0 \lt ... \lt r_m \in [r_{min}, r_{max}] }[/math]
- a series of values in the colorspace [math]\displaystyle{ c_0,..., c_m \in C }[/math]
- the mapping [math]\displaystyle{ f(r_i) = c_i ,i = 0,...,m }[/math]
- a rule for interpolating the intermediate values [math]\displaystyle{ r_{i-1} \lt r \lt r_i \in [r_{min}, r_{max}] }[/math]
where:
- r is a real number [math]\displaystyle{ r \in [r_{min}, r_{max}] \subset \mathbf{R} }[/math]
- [math]\displaystyle{ \mathbf{R} }[/math] is a set of real numbers
- c is a color = point in colorspace C
Types
Criteria for classification:
- dimension
- discrete ( clasessed ^{[4]}) / continuous
- shape
- range: full or limited. Example : pastel color with limited range of saturation.
- perceptual uniformity^{[5]}
- order
- ordered (sequential) and non-ordered (categorical)
- perceptual order
- readability for color-vision deficient or color-blind people ( colorblind-friendly)
- color space
- color depth
Dimension
- 1D
- 2D^{[6]}
- 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, then extended perpendicular to that line. In digital imaging systems, colors are typically interpolated in an RGB color space, often using gamma compressed RGB color values, as opposed to linear. CSS and SVG both support linear gradients.^{[7]}^{[8]}
Radial gradients
A radial gradient is specified as a circle 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 of light from a point source by a sphere. Both CSS and SVG support radial gradients.^{[9]}^{[10]}
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.^{[11]}
Other shapes
In vector graphics polygon meshes can be used, e.g., Adobe Illustrator supported gradient meshes.
color space
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 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 like red and green, with the middle color being a dark color instead of the expected yellow.^{[12]}^{[13]} The radial and conic examples on this page clearly exhibit this error.
- Handling of other perceptual properties. In information visualization, 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.^{[14]}
A "linear" blend would match physical light blending and has been the standard in game engines for a long time.^{[15]} On the web, however, it has long been neglected for both color gradients and image scaling.^{[16]} Such a blend still has a subtle difference from one done in a perceptually-uniform color space.^{[17]}
Examples
Single hue ( monochromatic ) gradient
HSV rainbow
File formats
Extensions:^{[18]} ^{[19]}
- GIMP .gpl
- Adobe .aco, .acb, .act, .ase, .acf, .bcf, .clr
- AutoCAD .acb
- ColorSchemer .cs
- Corel .cpl, .xml (X5)
- ICC named color .icc OO.o .soc
- QuarkXPress qcl (+cui)
- RAL .bcs
- RIFF .pal
- Scribus .xml
- VivaDesigner .xml
Applications
- represent quantitative or ordinal values, like in heat maps. More precise description is in color box.^{[20]}
- fill a region:^{[21]} many window managers 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
CCC-Tool | Web tool for comprehensive creation, analyzing and testing of colormaps with the effort to minimize the needed interaction components.^{[22]} |
---|---|
ColorMeasures | Web tool for mathematical analysis of colormaps in multiple color spaces. |
Color Brewer | Web tool for choropleth map color schemes. |
Color Palette Helper | Web Tool for generating multi-hued, multi-stops color scales. |
Color Gradient | Web tool for generating color gradients and css code. |
Gencolormap | C++ software for generating of color maps for visualization |
See also
- Bokashi (printing)
- Color banding
- Color difference
- Color mapping; a function that maps (transforms) the colors of one image to the colors of another image
- Diffusion curve
- dithering
- Image gradient
- Mach banding
- Ombré
- Palette; a finite set of colors in no particular order
- Perceptually uniform color spaces
- Posterization
- Color chart
- swatch books ( like in Paper color swatch book or RAL CLASSIC K5 colour fan or Pantone color guides)
References
- ↑ Dave Green's `cubehelix' colour scheme
- ↑ Diverging Color Maps for Scientific Visualization - Kenneth Moreland
- ↑ The Good, the Bad, and the Ugly: A Theoretical Framework for the Assessment of Continuous Colormaps by Roxana Bujack, Terece L. Turton, Francesca Samsel, Colin Ware
- ↑ which-color-scale-to-use-in-data-vis by Lisa Charlotte Rost
- ↑ Fabio Crameri: Scientific colour maps
- ↑ A survey and task-based quality assessment of static 2D colormaps Author(s): Bernard, Jürgen; Steiger, Martin; Mittelstädt, Sebastian; Thum, Simon; Keim, Daniel; Kohlhammer, Jörn, In Kao, David L. (Ed.) ; Society for Imaging Science and Technology -IS&T-; Society of Photo-Optical Instrumentation Engineers -SPIE-, Bellingham/Wash.: Visualization and Data Analysis 2015 : 9–11 February 2015, San Francisco, California Bellingham, WA: SPIE, 2015 (Proceedings of SPIE 9397) ISBN:9781628414875
- ↑ Linear Gradients in "CSS Image Values and Replaced Content Module Level 3", W3C Candidate Recommendation, April 2012
- ↑ Linear Gradients in "SVG 1.1 (Second Edition)", W3C Recommendation, August 2011
- ↑ Radial Gradients in "CSS Image Values and Replaced Content Module Level 3", W3C Candidate Recommendation, April 2012
- ↑ Radial Gradients in "SVG 1.1 (Second Edition)", W3C Recommendation, August 2011
- ↑ mozilla docs: CSS conic-gradient
- ↑ Minute Physics (March 20, 2015). "Computer Color is Broken". https://www.youtube.com/watch?v=LKnqECcg6Gw.
- ↑ Novak, John (September 21, 2016). "What every coder should know about gamma". https://blog.johnnovak.net/2016/09/21/what-every-coder-should-know-about-gamma/.
- ↑ Zeileis, Achim; Fisher, Jason C.; Hornik, Kurt; Ihaka, Ross; McWhite, Claire D.; Murrell, Paul; Stauffer, Reto; Wilke, Claus O. (2019). "Colorspace: A Toolbox for Manipulating and Assessing Colors and Palettes". arXiv:1903.06490 [stat.CO].
- ↑ "Chapter 24. The Importance of Being Linear" (in en). https://developer.nvidia.com/gpugems/gpugems3/part-iv-image-effects/chapter-24-importance-being-linear.
- ↑ "Web color is still broken". https://webcolorisstillbroken.com.
- ↑ "How software gets color wrong" (in en). https://bottosson.github.io/posts/colorwrong/.
- ↑ inkscape wiki : Swatch Book
- ↑ swatches gradients file formats by salepa
- ↑ gnuplot docs 4.2 node167: Color box
- ↑ Eisenberg, J. David (2002). SVG Essentials. O'Reilly Media. p. 107. ISBN 0-596-00223-8. https://archive.org/details/svgessentials00eise_317.
- ↑ Nardini, Pascal; Chen, Min; Samsel, Francesca; Bujack, Roxana; Bottinger, Michael; Scheuermann, Gerik (2019). "The Making of Continuous Colormaps". IEEE Transactions on Visualization and Computer Graphics 27 (6): 3048–3063. doi:10.1109/TVCG.2019.2961674. PMID 31870986. https://ora.ox.ac.uk/objects/uuid:c0fa420f-eccd-43e8-95db-cafe6864b3f8.
Original source: https://en.wikipedia.org/wiki/Color gradient.
Read more |