mirror of
https://github.com/opensim/opensim.git
synced 2026-05-18 04:45:35 +08:00
let you specify a hex number as the color in the vector rendering
module. This expands the colors you can use.
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user