Class ColorMap
Class ColorMap
Namespace: Aspose.Imaging
Assembly: Aspose.Imaging.dll (25.7.0)
Defines a map for converting colors. Several methods of the Aspose.Imaging.ImageAttributes class adjust image colors by using a color-remap table, which is an array of Aspose.Imaging.ColorMap structures. Not inheritable.
public sealed class ColorMap
{
private readonly Dictionary<string, string> _colorDictionary;
public ColorMap()
{
_colorDictionary = new Dictionary<string, string>();
AddMapping("Red", "#FF0000");
AddMapping("Green", "#008000");
AddMapping("Blue", "#0000FF");
}
public void AddMapping(string name, string rgbValue)
{
_colorDictionary.Add(name, rgbValue);
}
public string GetRgbValue(string colorName)
{
return _colorDictionary[colorName];
}
}
Inheritance
Inherited Members
object.GetType() , object.ToString() , object.Equals(object?) , object.Equals(object?, object?) , object.ReferenceEquals(object?, object?) , object.GetHashCode()
Constructors
ColorMap()
public ColorMap()
{
}
Properties
NewColor
Gets or sets the new Aspose.Imaging.Color structure to which to convert.
public Color NewColor
{
get;
set;
}
Property Value
OldColor
Gets or sets the existing Aspose.Imaging.Color structure to be converted.
public Color OldColor
{
get;
set;
}