MCPcopy Create free account
hub / github.com/9chu/LuaSTGPlus / XmlElementToColor

Method XmlElementToColor

TexturedFontEditor/Helper.cs:111–124  ·  view source on GitHub ↗
(XmlElement Node, string NodeName, string Attribute = "Value")

Source from the content-addressed store, hash-verified

109 }
110
111 public static Color XmlElementToColor(XmlElement Node, string NodeName, string Attribute = "Value")
112 {
113 string[] tRectArr = Helper.GetXmlResValue(Node, NodeName, Attribute).Split(',');
114
115 if (tRectArr.Length != 4)
116 throw new Exception("'" + NodeName + "'属性格式不正确: 请确保为'a,r,g,b'.");
117
118 return Color.FromArgb(
119 Convert.ToInt32(tRectArr[0]),
120 Convert.ToInt32(tRectArr[1]),
121 Convert.ToInt32(tRectArr[2]),
122 Convert.ToInt32(tRectArr[3])
123 );
124 }
125
126 public static RectangleF XmlElementToRectangleF(XmlElement Node, string NodeName, string Attribute = "Value")
127 {

Callers

nothing calls this directly

Calls 1

GetXmlResValueMethod · 0.80

Tested by

no test coverage detected