the colour of a point of the colour sphere, the hue from the azimuth and the lightness from the radius; the colouring the direction keys are built of
Syntax
rgb = sphereColor(radius, rho)
The colours of points of the sphere.
rgb = sphereColor(radius, rho, gray=1)
Full saturation everywhere.
rgb = sphereColor(radius, rho, colorStretching=2, hueCorrection=False)
Stretched, the plain hue circle.
Description
The colour sphere has a white centre at radius 1 and a black one at radius 0; on the circle radius 0.5 between them the colours are fully saturated and the azimuth rho turns the hue once around. Close to either centre the colours fade to gray: grayValue says how gray they are at the centre and grayGradient how fast the gray fades away from it. A direction key (HSVDirectionKey) maps its fundamental sector onto this sphere and calls sphereColor with its own grayValue, grayGradient and colorStretching.
Input
radius |
array, from 0 at the black centre to 1 at the white one |
rho |
array, the azimuth in radians, the hue |
Keywords
| keyword | default | description |
|---|---|---|
grayValue |
(0.2, 0.5) |
(white, black), the gray at the white and at the black centre, 0 none, 1 all |
grayGradient |
(0.5, 0.5) |
(white, black), how fast the gray fades away from the white and from the black centre |
colorStretching |
1.0 |
an exponent on the lightness, larger values giving more of the saturated colours of the middle |
gray |
None |
one saturation for every point, in [0, 1], instead of the fading towards the centres |
hueCorrection |
True |
even out the hue circle, so that red, green and blue take equal arcs |
Output
rgb |
array of shape (…, 3), RGB values in [0, 1] |
See also
HSVDirectionKey, direction2color, ipfHSVKey, EBSDIPFMap
source
Citing this page.
This page is part of the documentation of
MTEX, a free and open
source MATLAB toolbox for analyzing and modeling crystallographic textures.
It was written by The MTEX Developers and is published at
https://mtex-toolbox.github.io/sphereColor_py.html.
If you use MTEX, or reuse text or figures from this page, in your research,
please cite
F. Bachmann, R. Hielscher, H. Schaeben: Texture Analysis with MTEX - Free and Open Source Software Toolbox, Solid State Phenomena 160 (2010), 63-68. 10.4028/www.scientific.net/SSP.160.63
BibTeX
@article{bachmann2010mtex,
author = {F. Bachmann and R. Hielscher and H. Schaeben},
title = {Texture Analysis with MTEX - Free and Open Source Software Toolbox},
journal = {Solid State Phenomena},
volume = {160},
pages = {63-68},
year = {2010},
doi = {10.4028/www.scientific.net/SSP.160.63},
url = {https://doi.org/10.4028/www.scientific.net/SSP.160.63}
}
Other papers describing specific MTEX methods are listed under Publications — please cite the one that best fits your application. The MTEX source code is licensed under the GNU General Public License v2.0; the text and figures of this documentation are licensed under CC BY 4.0, which permits reuse — including by automated systems — provided The MTEX Developers and this page are credited.