From db4f4c255b5e5fa96bda5b60e39dc04815f19321 Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Fri, 19 Dec 2008 22:27:45 +0000 Subject: [PATCH] let you specify a hex number as the color in the vector rendering module. This expands the colors you can use. --- .../Scripting/VectorRender/VectorRenderModule.cs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/OpenSim/Region/Environment/Modules/Scripting/VectorRender/VectorRenderModule.cs b/OpenSim/Region/Environment/Modules/Scripting/VectorRender/VectorRenderModule.cs index 256bf27acf..6b9fde41bb 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 { nextLine = nextLine.Remove(0, 9); nextLine = nextLine.Trim(); + int hex = 0; - Color newColour = Color.FromName(nextLine); + Color newColour; + if(Int32.TryParse(nextLine, NumberStyles.HexNumber, CultureInfo.InvariantCulture, out hex)) + { + newColour = Color.FromArgb(hex); + } + else + { + // this doesn't fail, it just returns black if nothing is found + newColour = Color.FromName(nextLine); + } myBrush.Color = newColour; drawPen.Color = newColour;