IGLib
1.5
The IGLib base library for development of numerical, technical and business applications.
|
Extended color representation. Stores RGB components and opacity as double numbers ranging fom 0 to 1. Implicit conversions to and from System.Drawing.Color and form System.Drawing.KnownColor are provided. More...
Public Member Functions | |
color (double r, double g, double b, double opacity) | |
Creates a new color with specified red, green and blue components and opacity. More... | |
color (double r, double g, double b) | |
Creates a new color with specified red, green and blue components. Opacity is set to 1. More... | |
color (System.Drawing.Color color) | |
Creates a new color that corresponds (as closely as possible) to the specified color. More... | |
color (System.Drawing.KnownColor knownColor) | |
Creates a new color that corresponds to the specified known (system) color enumerated by the System.Drawing.KnownColor enumerator, such as KnownColor.Menu or KnownColor.WindowFrame. More... | |
color (color color) | |
Creates a new color that corresponds to the specified color. More... | |
color (string name) | |
Creates a new color that corresponds to the specified color name (e.g. "white", "blue", etc.). More... | |
double | ConvertComponent (int component) |
color | Scale (color[] colors, double minValue, double maxValue, double value) |
Returns a color corresponding to the specified value (within the specified range) where color scale begins with the first specified color (at the lower bound of the range) and smoothly changes through other colors up to the last specified color (at the higher bound of the range). More... | |
Static Public Member Functions | |
static implicit | operator System.Drawing.Color (color col) |
Converts color to standard System.Drawing.Color More... | |
static implicit | operator color (System.Drawing.Color col) |
Converts standard color representation System.Drawing.Color to extended representation color. More... | |
static implicit | operator color (System.Drawing.KnownColor knownColorEnum) |
Converts the System.Drawing.KnownColor enumerator to extended representation Color. More... | |
static color | Average (params color[] colors) |
Returns average of the specified colors. More... | |
static color | Average (bool clipComponents, params color[] colors) |
Returns average of the specified colors. More... | |
static color | Mixture (double weight1, color color1, double weight2, color color2) |
Returns additive mixture (linear combination) of two colors. More... | |
static color | Mixture (bool clipComponents, double weight1, color color1, double weight2, color color2) |
Returns additive mixture (linear combination) of two colors. More... | |
static color | Mixture (double[] weights, color[] colors) |
Returns additive mixture (linear combination) of the specified colors. More... | |
static color | Mixture (bool clipComponents, double[] weights, color[] colors) |
Returns additive mixture (linear combination) of the specified colors. More... | |
static color | Scale (color col1, color col2, double minValue, double maxValue, double value) |
Returns a color corresponding to the specified value (from the specified range) where color scale begins with the first specified color (lowest value) and smoothly changes to the second specified color (highest value). More... | |
static color | Scale (color col1, color col2, double value) |
Returns a color corresponding to the specified value (ranging from 0 to 1) where color scale begins with the first specified color (at 0) and smoothly changes to the second specified color (at 1). More... | |
static color | Scale (color[] colors, double value) |
Returns a color corresponding to the specified value (ranging from 0 to 1) where color scale begins with the first specified color (at 0) and smoothly changes through other colors up to the last specified color (at 1). More... | |
static color | ScaleGray (double minValue, double maxValue, double value) |
Returns a color corresponding to the specified value (from the specified range) where color scale begins with black and smoothly changes to white. More... | |
static color | ScaleGray (double value) |
Returns a color corresponding to the specified value (ranging from 0 to 1) where color scale begins with black and smoothly changes to white. More... | |
static color | ScaleRed (double minValue, double maxValue, double value) |
Returns a color corresponding to the specified value (from the specified range) where color scale begins with black and smoothly changes to red. More... | |
static color | ScaleRed (double value) |
Returns a color corresponding to the specified value (ranging from 0 to 1) where color scale begins with black and smoothly changes to red. More... | |
static color | ScaleGreen (double minValue, double maxValue, double value) |
Returns a color corresponding to the specified value (from the specified range) where color scale begins with black and smoothly changes to green. More... | |
static color | ScaleGreen (double value) |
Returns a color corresponding to the specified value (ranging from 0 to 1) where color scale begins with black and smoothly changes to green. More... | |
static color | ScaleBlue (double minValue, double maxValue, double value) |
Returns a color corresponding to the specified value (from the specified range) where color scale begins with black and smoothly changes to blue. More... | |
static color | ScaleBlue (double value) |
Returns a color corresponding to the specified value (ranging from 0 to 1) where color scale begins with black and smoothly changes to blue. More... | |
static color | ScaleYellow (double minValue, double maxValue, double value) |
Returns a color corresponding to the specified value (from the specified range) where color scale begins with black and smoothly changes to blue. More... | |
static color | ScaleYellow (double value) |
Returns a color corresponding to the specified value (ranging from 0 to 1) where color scale begins with black and smoothly changes to blue. More... | |
static color | ScaleBlueRedYellow (double minValue, double maxValue, double value) |
Returns a color corresponding to the specified value (from the specified range) where color scale begins with blue, then changes to red and finally to yellow. More... | |
static color | ScaleBlueRedYellow (double value) |
Returns a color corresponding to the specified value (ranging from 0 to 1) where color scale begins with blue, then changes to red and finally to yellow. More... | |
Public Attributes | |
double | _G |
double | _B |
double | _opacity |
const int | MaxIntComponent = 255 |
Maximal integer component of the standard System.Drawing.Color struct. More... | |
const double | MaxIntComponentD = MaxIntComponent |
Maximal component of the standard System.Drawing.Color struct as double. More... | |
Properties | |
double | R [get, set] |
Red component of the color (range from 0 to 1). More... | |
double | G [get, set] |
Green component of the color (range from 0 to 1). More... | |
double | B [get, set] |
Blue component of the color (range from 0 to 1). More... | |
double | Opacity [get, set] |
Opacity of the color (range from 0 - completely transparent - to 1 - completely opaque). More... | |
int | IntR [get, set] |
Gets or sets the red RGB component as integer in the range 0 to 255. Getter clips the returned value if it would exceed the range. Setter does not perform clipping. More... | |
int | IntG [get, set] |
Gets or sets the green RGB component as integer in the range 0 to 255. Getter clips the returned value if it would exceed the range. Setter does not perform clipping. More... | |
int | IntB [get, set] |
Gets or sets the blue RGB component as integer in the range 0 to 255. Getter clips the returned value if it would exceed the range. Setter does not perform clipping. More... | |
int | IntOpacity [get, set] |
Gets or sets the Opacity as integer in the range 0 to 255. Getter clips the returned value if it would exceed the range. Setter does not perform clipping. More... | |
float | FloatR [get] |
Gets the red RGB component of the current color as float number in the range 0 to 1. No clipping is performed. More... | |
float | FloatG [get] |
Gets the green RGB component of the current color as float number in the range 0 to 1. No clipping is performed. More... | |
float | FloatB [get] |
Gets the blue RGB component of the current color as float number in the range 0 to 1. No clipping is performed. More... | |
float | FloatOpacity [get] |
Gets the opacity of the current color as float number in the range 0 to 1. No clipping is performed. More... | |
double | Hue [get] |
Gets the hue-saturation-brightnes (HSB) value for hue of the current color (in the range 0 to 1). More... | |
double | Saturation [get] |
Gets the hue-saturation-brightnes (HSB) value for hue of the current color (in the range 0 to 1). More... | |
double | Brightness [get] |
Gets the hue-saturation-brightnes (HSB) value for brightness of the current color (in the range 0 to 1). More... | |
Private Attributes | |
double | _R |
Extended color representation. Stores RGB components and opacity as double numbers ranging fom 0 to 1. Implicit conversions to and from System.Drawing.Color and form System.Drawing.KnownColor are provided.
$A Igor xx;
|
inline |
Creates a new color with specified red, green and blue components and opacity.
r | Red component of the created color (range 0 to 1). |
g | Green component of the created color (range 0 to 1). |
b | Blue component of the created color (range 0 to 1). |
opacity | Opacity of the created color (range 0 - completely transparent, 1 - completely opaque). |
|
inline |
Creates a new color with specified red, green and blue components. Opacity is set to 1.
r | Red component of the created color (range 0 to 1). |
g | Green component of the created color (range 0 to 1). |
b | Blue component of the created color (range 0 to 1). |
|
inline |
Creates a new color that corresponds (as closely as possible) to the specified color.
color | Color that is copied to the created color. |
References IG.Lib.color.B, IG.Lib.color.G, and IG.Lib.color.R.
|
inline |
Creates a new color that corresponds to the specified known (system) color enumerated by the System.Drawing.KnownColor enumerator, such as KnownColor.Menu or KnownColor.WindowFrame.
knownColor | Color name. |
|
inline |
Creates a new color that corresponds to the specified color.
color | Color that is copied to the created color. |
References IG.Lib.color.B, IG.Lib.color.G, IG.Lib.color.Opacity, and IG.Lib.color.R.
|
inline |
Creates a new color that corresponds to the specified color name (e.g. "white", "blue", etc.).
name | Color name. |
|
inline |
|
inlinestatic |
Converts color to standard System.Drawing.Color
col | Color to be converted. |
References IG.Lib.color.B, IG.Lib.color.G, IG.Lib.color.Opacity, and IG.Lib.color.R.
|
inlinestatic |
|
inlinestatic |
Returns average of the specified colors.
The calculated color components are clipped to their prescribed range.
colors | Colors to be averaged. |
Referenced by IG.Gr3d.TestVtkGraphicBase.ExampleCellsGridContours(), and IG.Gr3d.TestVtkGraphicBase.ExampleCellsGridEfficient().
Returns average of the specified colors.
Depending on the specified flag, clipping of calculated color components to the prescribed range is performed or not.
clipComponents | Whether the resulting color components are clipped to the prescribed range or not. |
colors | Colors to be averaged. |
References IG.Lib.color.B, IG.Lib.color.G, IG.Lib.color.Opacity, and IG.Lib.color.R.
|
inlinestatic |
Returns additive mixture (linear combination) of two colors.
The calculated color components are clipped to their prescribed range.
The sum of weights will usually be normalized 1, but this is not necessary. The method itself does not provide normalization.
weight1 | Weighting factor for the first color. |
color1 | The first color to be mixed. |
weight2 | Weighting factor for the second color. |
color2 | The second color to be mixed. |
Referenced by IG.Lib.ColorScale.GetContinuousReferenceColor().
|
inlinestatic |
Returns additive mixture (linear combination) of two colors.
Depending on the specified flag, clipping of calculated color components to the prescribed range is performed or not.
The sum of weights will usually be normalized 1, but this is not necessary. The method itself does not provide normalization.
clipComponents | Whether the resulting color components are clipped to the prescribed range or not. |
weight1 | Weighting factor for the first color. |
color1 | The first color to be mixed. |
weight2 | Weighting factor for the second color. |
color2 | The second color to be mixed. |
References IG.Lib.color.B, IG.Lib.color.G, IG.Lib.color.Opacity, and IG.Lib.color.R.
Returns additive mixture (linear combination) of the specified colors.
The calculated color components are clipped to their prescribed range.
The sum of specified weights will usually be normalized 1, but this is not necessary. The method itself does not provide normalization.
weights | Weights vorresponding to colors that are mixed. Usually the sum of weights will be 1. |
colors | Colors to be additively mixed. |
|
inlinestatic |
Returns additive mixture (linear combination) of the specified colors.
Depending on the specified flag, clipping of calculated color components to the prescribed range is performed or not.
The sum of specified weights will usually be normalized 1, but this is not necessary. The method itself does not provide normalization.
clipComponents | Whether the resulting color components are clipped to the prescribed range or not. |
weights | Weights vorresponding to colors that are mixed. Usually the sum of weights will be 1. |
colors | Colors to be additively mixed. |
References IG.Lib.color.B, IG.Lib.color.G, IG.Lib.color.Opacity, and IG.Lib.color.R.
|
inlinestatic |
Returns a color corresponding to the specified value (from the specified range) where color scale begins with the first specified color (lowest value) and smoothly changes to the second specified color (highest value).
If the value is out of range then colors for lower or upper end of scale are returned, dependent on whether value is smaller than the lower bound or larger than the upper bound.
col1 | Collor corresponding to the lowest value of the scale. |
col2 | Collor corresponding to the highest value of the scale. |
minValue | Lowest value for the color. |
maxValue | Highest value for the color. |
value | Value for which the corresponding color is returned. |
Referenced by IG.Lib.ColorScale.GetContinuousReferenceColor().
Returns a color corresponding to the specified value (ranging from 0 to 1) where color scale begins with the first specified color (at 0) and smoothly changes to the second specified color (at 1).
If the value is out of range then colors for lower or upper end of scale are returned, dependent on whether value is smaller than the lower bound or larger than the upper bound.
col1 | Color corresponding to the lowest value of the scale. |
col2 | Color corresponding to the highest value of the scale. |
value | Value for which the corresponding color is returned. Should be between 0 or 1. |
References IG.Lib.color.B, IG.Lib.color.G, IG.Lib.color.Opacity, and IG.Lib.color.R.
Returns a color corresponding to the specified value (within the specified range) where color scale begins with the first specified color (at the lower bound of the range) and smoothly changes through other colors up to the last specified color (at the higher bound of the range).
If the value is out of range then color for lower or upper end of scale is returned, dependent on whether value is smaller than the lower bound or larger than the upper bound.
colors | Table of colors that are used in color scale. The first color of the table corresponds to the lower bound of the range, and the last one corresponds to the upper bound of the range. Colors between correspond to equally spaced values between, and colors between these values continuously change between two neighboring colors from the table. |
minValue | Lower bound of the range of values for which colors are assigned. |
maxValue | Upper bound of the range of values for which colors are assigned. |
value | Value for which the corresponding color is returned. Should be between 0 or 1. |
Returns a color corresponding to the specified value (ranging from 0 to 1) where color scale begins with the first specified color (at 0) and smoothly changes through other colors up to the last specified color (at 1).
If the value is out of range then colors for lower or upper end of scale are returned, dependent on whether value is smaller than the lower bound or larger than the upper bound.
colors | Table of colors that are used in color scale. The first color of the table corresponds to the lower bound of the range, and the last one corresponds to the upper bound of the range. Colors between correspond to equally spaced values between, and colors between these values continuously change between two neighboring colors from the table. |
value | Value for which the corresponding color is returned. Should be between 0 or 1. |
References IG.Lib.color.B, IG.Lib.color.G, IG.Lib.color.Opacity, and IG.Lib.color.R.
|
inlinestatic |
Returns a color corresponding to the specified value (from the specified range) where color scale begins with black and smoothly changes to white.
If the value is out of range then colors for lower or upper end of scale are returned, dependent on whether the value is smaller than the lower bound or larger than the upper bound.
minValue | Minimal value of the scale. |
maxValue | Maximal value of the scale. |
value | Value for which the corresponding color is returned. |
|
inlinestatic |
Returns a color corresponding to the specified value (ranging from 0 to 1) where color scale begins with black and smoothly changes to white.
If the value is out of range then colors for lower or upper end of scale are returned, dependent on whether value is smaller than the lower bound or larger than the upper bound.
value | Value for which the corresponding color is returned. Range of the scale is between 0 or 1. |
|
inlinestatic |
Returns a color corresponding to the specified value (from the specified range) where color scale begins with black and smoothly changes to red.
If the value is out of range then colors for lower or upper end of scale are returned, dependent on whether the value is smaller than the lower bound or larger than the upper bound.
minValue | Minimal value of the scale. |
maxValue | Maximal value of the scale. |
value | Value for which the corresponding color is returned. |
|
inlinestatic |
Returns a color corresponding to the specified value (ranging from 0 to 1) where color scale begins with black and smoothly changes to red.
If the value is out of range then colors for lower or upper end of scale are returned, dependent on whether value is smaller than the lower bound or larger than the upper bound.
value | Value for which the corresponding color is returned. Range of the scale is between 0 or 1. |
|
inlinestatic |
Returns a color corresponding to the specified value (from the specified range) where color scale begins with black and smoothly changes to green.
If the value is out of range then colors for lower or upper end of scale are returned, dependent on whether the value is smaller than the lower bound or larger than the upper bound.
minValue | Minimal value of the scale. |
maxValue | Maximal value of the scale. |
value | Value for which the corresponding color is returned. |
|
inlinestatic |
Returns a color corresponding to the specified value (ranging from 0 to 1) where color scale begins with black and smoothly changes to green.
If the value is out of range then colors for lower or upper end of scale are returned, dependent on whether value is smaller than the lower bound or larger than the upper bound.
value | Value for which the corresponding color is returned. Range of the scale is between 0 or 1. |
|
inlinestatic |
Returns a color corresponding to the specified value (from the specified range) where color scale begins with black and smoothly changes to blue.
If the value is out of range then colors for lower or upper end of scale are returned, dependent on whether the value is smaller than the lower bound or larger than the upper bound.
minValue | Minimal value of the scale. |
maxValue | Maximal value of the scale. |
value | Value for which the corresponding color is returned. |
|
inlinestatic |
Returns a color corresponding to the specified value (ranging from 0 to 1) where color scale begins with black and smoothly changes to blue.
If the value is out of range then colors for lower or upper end of scale are returned, dependent on whether value is smaller than the lower bound or larger than the upper bound.
value | Value for which the corresponding color is returned. Range of the scale is between 0 or 1. |
|
inlinestatic |
Returns a color corresponding to the specified value (from the specified range) where color scale begins with black and smoothly changes to blue.
If the value is out of range then colors for lower or upper end of scale are returned, dependent on whether the value is smaller than the lower bound or larger than the upper bound.
minValue | Minimal value of the scale. |
maxValue | Maximal value of the scale. |
value | Value for which the corresponding color is returned. |
|
inlinestatic |
Returns a color corresponding to the specified value (ranging from 0 to 1) where color scale begins with black and smoothly changes to blue.
If the value is out of range then colors for lower or upper end of scale are returned, dependent on whether value is smaller than the lower bound or larger than the upper bound.
value | Value for which the corresponding color is returned. Range of the scale is between 0 or 1. |
|
inlinestatic |
Returns a color corresponding to the specified value (from the specified range) where color scale begins with blue, then changes to red and finally to yellow.
If the value is out of range then colors for lower or upper end of scale are returned, dependent on whether value is smaller than the lower bound or larger than the upper bound.
minValue | Minimal value of the scale. |
maxValue | Maximal value of the scale. |
value | Value for which the corresponding color is returned. |
|
inlinestatic |
Returns a color corresponding to the specified value (ranging from 0 to 1) where color scale begins with blue, then changes to red and finally to yellow.
If the value is out of range then colors for lower or upper end of scale are returned, dependent on whether value is smaller than the lower bound or larger than the upper bound.
value | Value for which the corresponding color is returned. Range of the scale is between 0 or 1. |
|
private |
double IG.Lib.color._G |
double IG.Lib.color._B |
double IG.Lib.color._opacity |
const int IG.Lib.color.MaxIntComponent = 255 |
Maximal integer component of the standard System.Drawing.Color struct.
const double IG.Lib.color.MaxIntComponentD = MaxIntComponent |
Maximal component of the standard System.Drawing.Color struct as double.
|
getset |
Red component of the color (range from 0 to 1).
Referenced by IG.Lib.color.Average(), IG.Lib.color.color(), IG.Gr3d.TestVtkGraphicBase.ColorBar(), IG.Gr.GraphicPrimitiveBase.GetFillColor(), IG.Gr.GraphicPrimitiveBase.GetLineColor(), IG.Gr3d.UtilVtk.LookUpTableRange(), IG.Lib.color.Mixture(), IG.Lib.color.operator System.Drawing.Color(), and IG.Lib.color.Scale().
|
getset |
Green component of the color (range from 0 to 1).
Referenced by IG.Lib.color.Average(), IG.Lib.color.color(), IG.Gr3d.TestVtkGraphicBase.ColorBar(), IG.Gr.GraphicPrimitiveBase.GetFillColor(), IG.Gr.GraphicPrimitiveBase.GetLineColor(), IG.Gr3d.UtilVtk.LookUpTableRange(), IG.Lib.color.Mixture(), IG.Lib.color.operator System.Drawing.Color(), and IG.Lib.color.Scale().
|
getset |
Blue component of the color (range from 0 to 1).
Referenced by IG.Lib.color.Average(), IG.Lib.color.color(), IG.Gr3d.TestVtkGraphicBase.ColorBar(), IG.Gr.GraphicPrimitiveBase.GetFillColor(), IG.Gr.GraphicPrimitiveBase.GetLineColor(), IG.Gr3d.UtilVtk.LookUpTableRange(), IG.Lib.color.Mixture(), IG.Lib.color.operator System.Drawing.Color(), and IG.Lib.color.Scale().
|
getset |
Opacity of the color (range from 0 - completely transparent - to 1 - completely opaque).
Referenced by IG.Lib.color.Average(), IG.Lib.color.color(), IG.Gr3d.TestVtkGraphicBase.ColorBar(), IG.Gr.GraphicPrimitiveBase.GetFillColor(), IG.Gr.GraphicPrimitiveBase.GetLineColor(), IG.Gr3d.UtilVtk.LookUpTableRange(), IG.Lib.color.Mixture(), IG.Lib.color.operator System.Drawing.Color(), and IG.Lib.color.Scale().
|
getset |
Gets or sets the red RGB component as integer in the range 0 to 255. Getter clips the returned value if it would exceed the range. Setter does not perform clipping.
Referenced by IG.Gr3d.VtkCurvePlot.Create(), IG.Gr3d.VtkSurfacePlot.Create(), IG.Gr3d.TestVtkGraphicBase.ExampleCellsGridContours(), IG.Gr3d.TestVtkGraphicBase.ExampleCellsGridEfficient(), and IG.Gr3d.TestVtkGraphicBase.ExampleStructuredGrid().
|
getset |
Gets or sets the green RGB component as integer in the range 0 to 255. Getter clips the returned value if it would exceed the range. Setter does not perform clipping.
Referenced by IG.Gr3d.VtkCurvePlot.Create(), IG.Gr3d.VtkSurfacePlot.Create(), IG.Gr3d.TestVtkGraphicBase.ExampleCellsGridContours(), IG.Gr3d.TestVtkGraphicBase.ExampleCellsGridEfficient(), and IG.Gr3d.TestVtkGraphicBase.ExampleStructuredGrid().
|
getset |
Gets or sets the blue RGB component as integer in the range 0 to 255. Getter clips the returned value if it would exceed the range. Setter does not perform clipping.
Referenced by IG.Gr3d.VtkCurvePlot.Create(), IG.Gr3d.VtkSurfacePlot.Create(), IG.Gr3d.TestVtkGraphicBase.ExampleCellsGridContours(), IG.Gr3d.TestVtkGraphicBase.ExampleCellsGridEfficient(), and IG.Gr3d.TestVtkGraphicBase.ExampleStructuredGrid().
|
getset |
Gets or sets the Opacity as integer in the range 0 to 255. Getter clips the returned value if it would exceed the range. Setter does not perform clipping.
|
get |
Gets the red RGB component of the current color as float number in the range 0 to 1. No clipping is performed.
|
get |
Gets the green RGB component of the current color as float number in the range 0 to 1. No clipping is performed.
|
get |
Gets the blue RGB component of the current color as float number in the range 0 to 1. No clipping is performed.
|
get |
Gets the opacity of the current color as float number in the range 0 to 1. No clipping is performed.
|
get |
Gets the hue-saturation-brightnes (HSB) value for hue of the current color (in the range 0 to 1).
|
get |
Gets the hue-saturation-brightnes (HSB) value for hue of the current color (in the range 0 to 1).
|
get |
Gets the hue-saturation-brightnes (HSB) value for brightness of the current color (in the range 0 to 1).