diff options
Diffstat (limited to 'OpenSim/Region/Environment/Modules')
-rw-r--r-- | OpenSim/Region/Environment/Modules/Scripting/VectorRender/VectorRenderModule.cs | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/OpenSim/Region/Environment/Modules/Scripting/VectorRender/VectorRenderModule.cs b/OpenSim/Region/Environment/Modules/Scripting/VectorRender/VectorRenderModule.cs index 256bf27..6b9fde4 100644 --- a/OpenSim/Region/Environment/Modules/Scripting/VectorRender/VectorRenderModule.cs +++ b/OpenSim/Region/Environment/Modules/Scripting/VectorRender/VectorRenderModule.cs | |||
@@ -322,8 +322,18 @@ namespace OpenSim.Region.Environment.Modules.Scripting.VectorRender | |||
322 | { | 322 | { |
323 | nextLine = nextLine.Remove(0, 9); | 323 | nextLine = nextLine.Remove(0, 9); |
324 | nextLine = nextLine.Trim(); | 324 | nextLine = nextLine.Trim(); |
325 | int hex = 0; | ||
325 | 326 | ||
326 | Color newColour = Color.FromName(nextLine); | 327 | Color newColour; |
328 | if(Int32.TryParse(nextLine, NumberStyles.HexNumber, CultureInfo.InvariantCulture, out hex)) | ||
329 | { | ||
330 | newColour = Color.FromArgb(hex); | ||
331 | } | ||
332 | else | ||
333 | { | ||
334 | // this doesn't fail, it just returns black if nothing is found | ||
335 | newColour = Color.FromName(nextLine); | ||
336 | } | ||
327 | 337 | ||
328 | myBrush.Color = newColour; | 338 | myBrush.Color = newColour; |
329 | drawPen.Color = newColour; | 339 | drawPen.Color = newColour; |