Class RangeColorRule
Defines a rule for mapping numeric values to colors based on a range.
public class RangeColorRule : IMakeXmlSource, IGetRangeColorRule
- Inheritance
-
RangeColorRule
- Implements
- Inherited Members
- Extension Methods
Constructors
RangeColorRule()
Ctor.
public RangeColorRule()
RangeColorRule(double, double, RatioRgbFuncEnum)
Constructor with range and color function specification.
public RangeColorRule(double floor, double ceiling, RatioRgbFuncEnum ratioRgbFuncEnum = RatioRgbFuncEnum.NormalizedPositiveErf)
Parameters
floor
doubleThe lower bound of the range.
ceiling
doubleThe upper bound of the range.
ratioRgbFuncEnum
RatioRgbFuncEnumThe function to map ratio values to RGB colors.
RangeColorRule(XElement)
Ctor.
public RangeColorRule(XElement src)
Parameters
src
XElementXML
Fields
RatioRgbFuncEnum
The function used to map ratio values to RGB colors.
public RatioRgbFuncEnum RatioRgbFuncEnum
Field Value
Properties
Ceiling
Gets or sets the upper bound of the range.
public double Ceiling { get; set; }
Property Value
Floor
Gets or sets the lower bound of the range.
public double Floor { get; set; }
Property Value
XName
Name for XML IO.
public static string XName { get; }
Property Value
Methods
GetRangeColorRule()
Gets the range color rule.
public RangeColorRule GetRangeColorRule()
Returns
- RangeColorRule
The range color rule.
GetRgb(double)
Gets the RGB color for a given value based on the range and color function.
public Vec3d GetRgb(double v)
Parameters
v
doubleThe value to convert to a color.
Returns
- Vec3d
RGB color vector.
MakeXmlSource(string, string)
Creates an XML representation of the object. This method may also generate additional resources such as related files.
public XElement MakeXmlSource(string baseDirectory, string relFile)
Parameters
baseDirectory
stringThe base directory for resolving relative paths
relFile
stringThe relative file path for the XML source
Returns
- XElement
An XML element representing the object's state