let you specify a hex number as the color in the vector rendering

module.  This expands the colors you can use.
0.6.1-post-fixes
Sean Dague 2008-12-19 22:27:45 +00:00
parent 11d0456246
commit db4f4c255b
1 changed files with 11 additions and 1 deletions

View File

@ -322,8 +322,18 @@ namespace OpenSim.Region.Environment.Modules.Scripting.VectorRender
{ {
nextLine = nextLine.Remove(0, 9); nextLine = nextLine.Remove(0, 9);
nextLine = nextLine.Trim(); 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; myBrush.Color = newColour;
drawPen.Color = newColour; drawPen.Color = newColour;