Class XmlColor
- Assembly
- MonoGame.Framework.Content.Pipeline.dll
Helper for serializing color types with the XmlSerializer.
public class XmlColor
- Inheritance
-
XmlColor
- Inherited Members
Constructors
XmlColor()
Creates a new instance of XmlColor with Empty color.
public XmlColor()
XmlColor(Color)
Creates a new instance of XmlColor with provided color
public XmlColor(Color c)
Parameters
c
ColorColor to be stored
Properties
Default
Default color value as a string, used for serialization and deserialization.
public string Default { get; set; }
Property Value
Methods
FromColor(Color)
Returns a string representation of the supplied Color.
public static string FromColor(Color color)
Parameters
color
ColorColor to be converted.
Returns
- string
The predefined name of the color, if it's named, or a string in the format "R, G, B, A", if the color is not named, with every component in the [0..255] range.
Remarks
This string value can be used in ToColor(string) to get identical color object.
ToColor(string)
Returns a new Color object from its string representation.
public static Color ToColor(string value)
Parameters
value
stringA predefined color name, OR a string in the format "R, G, B, A", where each component is in the [0..255] range.
Returns
Operators
implicit operator Color(XmlColor)
Implicit XmlColor -> Color conversion
public static implicit operator Color(XmlColor x)
Parameters
x
XmlColor
Returns
implicit operator XmlColor(Color)
Implicit Color -> XmlColor conversion
public static implicit operator XmlColor(Color c)
Parameters
c
Color