+++ /dev/null
-//
-// ScrollingTextBox.cs
-//
-// Author:
-// Jean-Philippe Bruyère <jp.bruyere@hotmail.com>
-//
-// Copyright (c) 2013-2017 Jean-Philippe Bruyère
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-using System;
-using System.Xml.Serialization;
-using System.ComponentModel;
-using System.Collections;
-using Cairo;
-using System.Text;
-using System.Collections.Generic;
-using System.Text.RegularExpressions;
-using System.Linq;
-using System.Diagnostics;
-using System.IO;
-using System.Threading;
-
-namespace Crow.Coding
-{
- /// <summary>
- /// Scrolling text box optimized for monospace fonts, for coding
- /// </summary>
- public class SourceEditor : Editor
- {
- #region CTOR
- public SourceEditor (): base()
- {
- formatting.Add ((int)XMLParser.TokenType.AttributeName, new TextFormatting (Color.DarkJungleGreen, Color.Transparent));
- formatting.Add ((int)XMLParser.TokenType.ElementName, new TextFormatting (Color.DarkBlue, Color.Transparent));
- formatting.Add ((int)XMLParser.TokenType.ElementStart, new TextFormatting (Color.Black, Color.Transparent));
- formatting.Add ((int)XMLParser.TokenType.ElementEnd, new TextFormatting (Color.Black, Color.Transparent));
- formatting.Add ((int)XMLParser.TokenType.ElementClosing, new TextFormatting (Color.Black, Color.Transparent));
-
- formatting.Add ((int)XMLParser.TokenType.AttributeValueOpening, new TextFormatting (Color.Carmine, Color.Transparent));
- formatting.Add ((int)XMLParser.TokenType.AttributeValueClosing, new TextFormatting (Color.Carmine, Color.Transparent));
- formatting.Add ((int)XMLParser.TokenType.AttributeValue, new TextFormatting (Color.TractorRed, Color.Transparent, false, true));
- formatting.Add ((int)XMLParser.TokenType.XMLDecl, new TextFormatting (Color.AoEnglish, Color.Transparent));
-
- formatting.Add ((int)BufferParser.TokenType.BlockComment, new TextFormatting (Color.Gray, Color.Transparent, false, true));
- formatting.Add ((int)BufferParser.TokenType.LineComment, new TextFormatting (Color.Gray, Color.Transparent, false, true));
- formatting.Add ((int)BufferParser.TokenType.OperatorOrPunctuation, new TextFormatting (Color.Black, Color.Transparent));
- formatting.Add ((int)BufferParser.TokenType.Keyword, new TextFormatting (Color.Teal, Color.Transparent));
- //formatting.Add ((int)BufferParser.TokenType.Keyword, new TextFormatting (Color.DarkCyan, Color.Transparent));
-
- parsing.Add (".crow", "Crow.Coding.XMLParser");
- parsing.Add (".svg", "Crow.Coding.XMLParser");
- parsing.Add (".template", "Crow.Coding.XMLParser");
- parsing.Add (".cs", "Crow.Coding.CSharpParser");
- parsing.Add (".style", "Crow.Coding.StyleParser");
-
- buffer = new CodeBuffer ();
- buffer.LineUpadateEvent += Buffer_LineUpadateEvent;
- buffer.LineAdditionEvent += Buffer_LineAdditionEvent;;
- buffer.LineRemoveEvent += Buffer_LineRemoveEvent;
- buffer.BufferCleared += Buffer_BufferCleared;
- buffer.SelectionChanged += Buffer_SelectionChanged;
- buffer.PositionChanged += Buffer_PositionChanged;
- buffer.FoldingEvent += Buffer_FoldingEvent;
- buffer.Add (new CodeLine(""));
- }
- #endregion
-
- string oldSource = "";
- //save requested position on error, and try it on next move
- int requestedLine = 0, requestedCol = 0;
- volatile bool isDirty = false;
-
- const int leftMarginGap = 10;//gap between items in margin and text
- const int foldSize = 9;//folding rectangles size
- const int foldHSpace = 4;//folding level tabulation x
- int foldMargin { get { return parser == null ? 0 : parser.SyntacticTreeMaxDepth * foldHSpace; }}//folding margin size
-
- #region private and protected fields
- bool foldingEnabled = true;
- int leftMargin = 0; //margin used to display line numbers, folding errors,etc...
- int visibleLines = 1;
- int visibleColumns = 1;
- int firstPrintedLine = -1;
- int printedCurrentLine = 0;//Index of the currentline in the PrintedLines array
-
- CodeBuffer buffer;
- BufferParser parser;
- List<CodeLine> PrintedLines;//list of lines visible in the Editor depending on scrolling and folding
-
- Dictionary<int, TextFormatting> formatting = new Dictionary<int, TextFormatting>();
- Dictionary<string, string> parsing = new Dictionary<string, string>();
-
- Color selBackground;
- Color selForeground;
- int selStartCol;
- int selEndCol;
-
- protected Rectangle rText;
- protected FontExtents fe;
- protected TextExtents te;
-
- Point mouseLocalPos;
- bool doubleClicked = false;
- #endregion
-
- void measureLeftMargin () {
- leftMargin = 0;
- if (PrintLineNumbers)
- leftMargin += (int)Math.Ceiling((double)buffer.LineCount.ToString().Length * fe.MaxXAdvance) +6;
- if (foldingEnabled)
- leftMargin += foldMargin;
- if (leftMargin > 0)
- leftMargin += leftMarginGap;
- updateVisibleColumns ();
- }
- void findLongestLineAndUpdateMaxScrollX() {
- buffer.FindLongestVisualLine ();
- updateMaxScrollX ();
-// Debug.WriteLine ("SourceEditor: Find Longest line and update maxscrollx: {0} visible cols:{1}", MaxScrollX, visibleColumns);
- }
- /// <summary>
- /// Updates visible line in widget, adapt max scroll y and updatePrintedLines
- /// </summary>
- void updateVisibleLines(){
- visibleLines = (int)Math.Floor ((double)ClientRectangle.Height / (fe.Ascent+fe.Descent));
- NotifyValueChanged ("VisibleLines", visibleLines);
- updateMaxScrollY ();
- updatePrintedLines ();
- RegisterForGraphicUpdate ();
-// System.Diagnostics.Debug.WriteLine ("update visible lines: " + visibleLines);
-// System.Diagnostics.Debug.WriteLine ("update MaxScrollY: " + MaxScrollY);
- }
- void updateVisibleColumns(){
- visibleColumns = (int)Math.Floor ((double)(ClientRectangle.Width - leftMargin)/ fe.MaxXAdvance);
- NotifyValueChanged ("VisibleColumns", visibleColumns);
- updateMaxScrollX ();
-// System.Diagnostics.Debug.WriteLine ("update visible columns: {0} leftMargin:{1}",visibleColumns, leftMargin);
-// System.Diagnostics.Debug.WriteLine ("update MaxScrollX: " + MaxScrollX);
- }
- void updateMaxScrollX () {
- MaxScrollX = Math.Max (0, buffer.longestLineCharCount - visibleColumns);
- if (buffer.longestLineCharCount > 0)
- NotifyValueChanged ("ChildWidthRatio", Slot.Width * visibleColumns / buffer.longestLineCharCount);
- }
- void updateMaxScrollY () {
- if (parser == null || !foldingEnabled) {
- MaxScrollY = Math.Max (0, buffer.LineCount - visibleLines);
- if (buffer.UnfoldedLines > 0)
- NotifyValueChanged ("ChildHeightRatio", Slot.Height * visibleLines / buffer.UnfoldedLines);
- } else {
- MaxScrollY = Math.Max (0, buffer.UnfoldedLines - visibleLines);
- if (buffer.UnfoldedLines > 0)
- NotifyValueChanged ("ChildHeightRatio", Slot.Height * visibleLines / buffer.UnfoldedLines);
- }
- }
- void updatePrintedLines () {
- buffer.editMutex.EnterReadLock ();
- editorMutex.EnterWriteLock ();
-
- PrintedLines = new List<CodeLine> ();
- int curL = 0;
- int i = 0;
-
- while (curL < buffer.LineCount && i < ScrollY) {
- if (buffer [curL].IsFolded)
- curL = buffer.GetEndNodeIndex (curL);
- curL++;
- i++;
- }
-
- firstPrintedLine = curL;
- i = 0;
- while (i < visibleLines && curL < buffer.LineCount) {
- PrintedLines.Add (buffer [curL]);
-
- if (buffer [curL].IsFolded)
- curL = buffer.GetEndNodeIndex (curL);
-
- curL++;
- i++;
- }
-
- buffer.editMutex.ExitReadLock ();
- editorMutex.ExitWriteLock ();
- }
- void updateOnScreenCurLineFromBuffCurLine(){
- printedCurrentLine = PrintedLines.IndexOf (buffer.CurrentCodeLine);
- }
- void toogleFolding (int line) {
- if (parser == null || !foldingEnabled)
- return;
- buffer.ToogleFolding (line);
- }
-
- #region Editor overrides
- protected override void updateEditorFromProjFile ()
- {
- buffer.editMutex.EnterWriteLock ();
- loadSource ();
- buffer.editMutex.ExitWriteLock ();
-
- isDirty = false;
- oldSource = projFile.Source;
- CurrentLine = requestedLine;
- CurrentColumn = requestedCol;
- projFile.RegisteredEditors [this] = true;
- }
- protected override void updateProjFileFromEditor ()
- {
- buffer.editMutex.EnterWriteLock ();
- string newsrc = buffer.FullText;
- buffer.editMutex.ExitWriteLock ();
- projFile.UpdateSource (this, newsrc);
- }
- protected override bool EditorIsDirty {
- get { return isDirty; }
- set { isDirty = value; }
- }
- protected override bool IsReady {
- get { return projFile != null && buffer != null; }
- }
- #endregion
-
- #region Buffer events handlers
- void Buffer_BufferCleared (object sender, EventArgs e)
- {
- editorMutex.EnterWriteLock ();
-
- buffer.longestLineCharCount = 0;
- buffer.longestLineIdx = 0;
- measureLeftMargin ();
- MaxScrollX = MaxScrollY = 0;
- PrintedLines = null;
- RegisterForGraphicUpdate ();
- notifyPositionChanged ();
- isDirty = true;
-
- editorMutex.ExitWriteLock ();
- }
- void Buffer_LineAdditionEvent (object sender, CodeBufferEventArgs e)
- {
- for (int i = 0; i < e.LineCount; i++) {
- int lptr = e.LineStart + i;
- int charCount = buffer[lptr].PrintableLength;
- if (charCount > buffer.longestLineCharCount) {
- buffer.longestLineIdx = lptr;
- buffer.longestLineCharCount = charCount;
- }else if (lptr <= buffer.longestLineIdx)
- buffer.longestLineIdx++;
- if (parser == null)
- continue;
- parser.TryParseBufferLine (e.LineStart + i);
- }
-
- if (parser != null)
- parser.reparseSource ();
-
- measureLeftMargin ();
-
- updatePrintedLines ();
- updateMaxScrollY ();
- RegisterForGraphicUpdate ();
- notifyPositionChanged ();
- isDirty = true;
- }
- void Buffer_LineRemoveEvent (object sender, CodeBufferEventArgs e)
- {
- bool trigFindLongestLine = false;
- for (int i = 0; i < e.LineCount; i++) {
- int lptr = e.LineStart + i;
- if (lptr <= buffer.longestLineIdx)
- trigFindLongestLine = true;
- }
- if (trigFindLongestLine)
- findLongestLineAndUpdateMaxScrollX ();
-
- measureLeftMargin ();
- updatePrintedLines ();
- updateMaxScrollY ();
- RegisterForGraphicUpdate ();
- notifyPositionChanged ();
- isDirty = true;
- }
- void Buffer_LineUpadateEvent (object sender, CodeBufferEventArgs e)
- {
- bool trigFindLongestLine = false;
- for (int i = 0; i < e.LineCount; i++) {
-
- int lptr = e.LineStart + i;
- if (lptr == buffer.longestLineIdx)
- trigFindLongestLine = true;
- else if (buffer[lptr].PrintableLength > buffer.longestLineCharCount) {
- buffer.longestLineCharCount = buffer[lptr].PrintableLength;
- buffer.longestLineIdx = lptr;
- }
- }
- if (trigFindLongestLine)
- findLongestLineAndUpdateMaxScrollX ();
-
- RegisterForGraphicUpdate ();
- notifyPositionChanged ();
- isDirty = true;
- }
- void Buffer_PositionChanged (object sender, EventArgs e)
- {
- Console.WriteLine ("Position changes: ({0},{1})", buffer.CurrentLine, buffer.CurrentColumn);
- int cc = buffer.CurrentTabulatedColumn;
-
- if (cc > visibleColumns + ScrollX) {
- ScrollX = cc - visibleColumns;
- } else if (cc < ScrollX)
- ScrollX = cc;
-
- RegisterForGraphicUpdate ();
- updateOnScreenCurLineFromBuffCurLine ();
- notifyPositionChanged ();
- }
-
- void Buffer_SelectionChanged (object sender, EventArgs e)
- {
- RegisterForGraphicUpdate ();
- }
- void Buffer_FoldingEvent (object sender, CodeBufferEventArgs e)
- {
- updatePrintedLines ();
- updateOnScreenCurLineFromBuffCurLine ();
- updateMaxScrollY ();
- RegisterForGraphicUpdate ();
- }
- #endregion
-
- void notifyPositionChanged (){
- try {
- NotifyValueChanged ("CurrentLine", buffer.CurrentLine+1);
- NotifyValueChanged ("CurrentColumn", buffer.CurrentColumn+1);
- NotifyValueChanged ("CurrentLineHasError", CurrentLineHasError);
- NotifyValueChanged ("CurrentLineError", CurrentLineError);
- } catch (Exception ex) {
- Console.WriteLine (ex.ToString ());
- }
- }
-
- #region Public Crow Properties
- public int CurrentLine{
- get { return buffer == null ? 0 : buffer.CurrentLine+1; }
- set {
- try {
- int l = value - 1;
- if (l == buffer.CurrentLine)
- return;
- buffer.CurrentLine = l;
- if (buffer [l].IsFolded)
- buffer.ToogleFolding (l);
- } catch (Exception ex) {
- requestedLine = value - 1;
- Console.WriteLine ("Error cur column: " + ex.ToString ());
- }
- }
- }
- public int CurrentColumn{
- get { return buffer == null ? 0 : buffer.CurrentColumn+1; }
- set {
- try {
- if (value - 1 == buffer.CurrentColumn)
- return;
- buffer.CurrentColumn = value - 1;
- } catch (Exception ex) {
- requestedCol = value - 1;
- Console.WriteLine ("Error cur column: " + ex.ToString ());
- }
- }
- }
- public bool PrintLineNumbers
- {
- get { return Configuration.Global.Get<bool> ("PrintLineNumbers"); }
- set {
- if (PrintLineNumbers == value)
- return;
- Configuration.Global.Set ("PrintLineNumbers", value);
- NotifyValueChanged ("PrintLineNumbers", PrintLineNumbers);
- measureLeftMargin ();
- RegisterForGraphicUpdate ();
- }
- }
- [DefaultValue("BlueGray")]
- public virtual Color SelectionBackground {
- get { return selBackground; }
- set {
- if (value == selBackground)
- return;
- selBackground = value;
- NotifyValueChanged ("SelectionBackground", selBackground);
- RegisterForRedraw ();
- }
- }
- [DefaultValue("White")]
- public virtual Color SelectionForeground {
- get { return selForeground; }
- set {
- if (value == selForeground)
- return;
- selForeground = value;
- NotifyValueChanged ("SelectionForeground", selForeground);
- RegisterForRedraw ();
- }
- }
- public override int ScrollY {
- get {
- return base.ScrollY;
- }
- set {
- if (value == base.ScrollY)
- return;
- base.ScrollY = value;
- updatePrintedLines ();
- updateOnScreenCurLineFromBuffCurLine ();
- RegisterForGraphicUpdate ();
- }
- }
- public ParserException CurrentLineError {
- get { return buffer?.CurrentCodeLine?.exception; }
- }
- public bool CurrentLineHasError {
- get { return buffer == null ? false : buffer.CurrentCodeLine == null ? false :
- buffer.CurrentCodeLine.exception != null; }
- }
- public override ProjectFile ProjectNode {
- get {
- return base.ProjectNode;
- }
- set {
- base.ProjectNode = value;
- if (projFile != null)
- parser = getParserFromExt (System.IO.Path.GetExtension (projFile.Extension));
- }
- }
- #endregion
-
- BufferParser getParserFromExt (string extension) {
- if (string.IsNullOrEmpty(extension))
- return null;
- if (!parsing.ContainsKey(extension))
- return null;
- Type parserType = Type.GetType (parsing [extension]);
- if (parserType == null)
- return null;
- return (BufferParser)Activator.CreateInstance (parserType, buffer );
- }
- void loadSource () {
-
- try {
-
- if (parser == null)
- buffer.Load (projFile.Source);
- else//parser may have special linebrk rules
- buffer.Load (projFile.Source, parser.LineBrkRegex);
-
- } catch (Exception ex) {
- Debug.WriteLine (ex.ToString ());
- }
-
- projFile.RegisteredEditors [this] = true;
-
- updateMaxScrollY ();
- MaxScrollX = Math.Max (0, buffer.longestLineCharCount - visibleColumns);
- updatePrintedLines ();
-
- RegisterForGraphicUpdate ();
- }
-
- /// <summary>
- /// Current editor line, when set, update buffer.CurrentLine
- /// </summary>
- int PrintedCurrentLine {
- get { return printedCurrentLine;}
- set {
- if (value < 0) {
- ScrollY += value;
- printedCurrentLine = 0;
- } else if (PrintedLines.Count < visibleLines && value >= PrintedLines.Count) {
- printedCurrentLine = PrintedLines.Count - 1;
- }else if (value >= visibleLines) {
- ScrollY += value - visibleLines + 1;
- printedCurrentLine = visibleLines - 1;
- }else
- printedCurrentLine = value;
- //Debug.WriteLine ("printed current line:" + printedCurrentLine.ToString ());
- //update position in buffer
- buffer.CurrentLine = buffer.IndexOf (PrintedLines[printedCurrentLine]);
- }
- }
- int getTabulatedColumn (int col, int line) {
- return buffer [line].Content.Substring (0, col).Replace ("\t", new String (' ', Interface.TabSize)).Length;
- }
- int getTabulatedColumn (Point pos) {
- return getTabulatedColumn (pos.X,pos.Y);
- }
- /// <summary>
- /// Moves cursor one char to the left, move up if cursor reaches start of line
- /// </summary>
- /// <returns><c>true</c> if move succeed</returns>
- public bool MoveLeft(){
- if (buffer.CurrentColumn == 0) {
- if (printedCurrentLine == 0)
- return false;
- PrintedCurrentLine--;
- buffer.CurrentColumn = int.MaxValue;
- } else
- buffer.CurrentColumn--;
- return true;
- }
- /// <summary>
- /// Moves cursor one char to the right, move down if cursor reaches end of line
- /// </summary>
- /// <returns><c>true</c> if move succeed</returns>
- public bool MoveRight(){
- if (buffer.CurrentColumn >= buffer.CurrentCodeLine.Length) {
- if (PrintedCurrentLine == buffer.UnfoldedLines - 1)
- return false;
- buffer.CurrentColumn = 0;
- PrintedCurrentLine++;
- } else
- buffer.CurrentColumn++;
- return true;
- }
-
- #region Drawing
- void drawLine(Context gr, Rectangle cb, int i) {
- CodeLine cl = PrintedLines[i];
- int lineIndex = buffer.IndexOf(cl);
-
- double y = cb.Y + (fe.Ascent+fe.Descent) * i, x = cb.X;
-
- //Draw line numbering
- Color mgFg = Color.Gray;
- Color mgBg = Color.White;
- if (PrintLineNumbers){
- Rectangle mgR = new Rectangle ((int)x, (int)y, leftMargin - leftMarginGap, (int)Math.Ceiling((fe.Ascent+fe.Descent)));
- if (cl.exception != null) {
- mgBg = Color.Red;
- if (buffer.CurrentLine == lineIndex)
- mgFg = Color.White;
- else
- mgFg = Color.LightGray;
- }else if (buffer.CurrentLine == lineIndex) {
- mgFg = Color.Black;
- mgBg = Color.DarkGray;
- }
- string strLN = (lineIndex+1).ToString ();
- gr.SetSourceColor (mgBg);
- gr.Rectangle (mgR);
- gr.Fill();
- gr.SetSourceColor (mgFg);
-
- gr.MoveTo (cb.X + (int)(gr.TextExtents (buffer.LineCount.ToString()).Width - gr.TextExtents (strLN).Width), y + fe.Ascent);
- gr.ShowText (strLN);
- gr.Fill ();
- }
-
-
-
- //draw folding
- if (foldingEnabled){
-
- Rectangle rFld = new Rectangle (cb.X + leftMargin - leftMarginGap - foldMargin,
- (int)(y + (fe.Ascent + fe.Descent) / 2.0 - foldSize / 2.0), foldSize, foldSize);
-
- gr.SetSourceColor (Color.Black);
- gr.LineWidth = 1.0;
-
- int level = 0;
- bool closingNode = false;
-
- if (currentNode != null) {
- if (cl == currentNode.EndLine) {
- currentNode = currentNode.Parent;
- closingNode = true;
- }
- if (currentNode != null)
- level = currentNode.Level - 1;
- }
-
- for (int l = 0; l < level; l++) {
- gr.MoveTo (rFld.Center.X + 0.5, y);
- gr.LineTo (rFld.Center.X + 0.5, y + fe.Ascent + fe.Descent);
- rFld.Left += foldHSpace;
- }
- if (closingNode) {
- gr.MoveTo (rFld.Center.X + 0.5, y);
- gr.LineTo (rFld.Center.X + 0.5, y + fe.Ascent / 2 + 0.5);
- gr.LineTo (rFld.Center.X + 0.5 + foldSize / 2, y + fe.Ascent / 2 + 0.5);
- closingNode = false;
- }
- gr.SetDash (new double[]{ 1.5 },0.0);
- gr.SetSourceColor (Color.Gray);
- gr.Stroke ();
- gr.SetDash (new double[]{}, 0.0);
-
- if (cl.IsFoldable) {
- gr.Rectangle (rFld);
- gr.SetSourceColor (Color.White);
- gr.Fill();
- gr.SetSourceColor (Color.Black);
- gr.Rectangle (rFld, 1.0);
- if (cl.IsFolded) {
- gr.MoveTo (rFld.Center.X + 0.5, rFld.Y + 2);
- gr.LineTo (rFld.Center.X + 0.5, rFld.Bottom - 2);
- }else
- currentNode = cl.SyntacticNode;
-
- gr.MoveTo (rFld.Left + 2, rFld.Center.Y + 0.5);
- gr.LineTo (rFld.Right - 2, rFld.Center.Y + 0.5);
- gr.Stroke ();
- }
- }
-
- gr.SetSourceColor (Foreground);
- x += leftMargin;
-
- if (cl.Tokens == null)
- drawRawCodeLine (gr, x, y, i, lineIndex);
- else
- drawParsedCodeLine (gr, x, y, i, lineIndex);
- }
- Node currentNode = null;
-// void drawParsed(Context gr){
-// if (PrintedLines == null)
-// return;
-//
-// gr.SelectFontFace (Font.Name, Font.Slant, Font.Wheight);
-// gr.SetFontSize (Font.Size);
-// gr.FontOptions = Interface.FontRenderingOptions;
-// gr.Antialias = Interface.Antialias;
-//
-// Rectangle cb = ClientRectangle;
-// gr.Save ();
-// CairoHelpers.CairoRectangle (gr, cb, CornerRadius);
-// gr.Clip ();
-//
-// bool selectionInProgress = false;
-//
-// Foreground.SetAsSource (gr);
-//
-// #region draw text cursor
-// if (SelBegin != SelRelease)
-// selectionInProgress = true;
-// else if (HasFocus){
-// gr.LineWidth = 1.0;
-// double cursorX = + leftMargin + cb.X + (CurrentColumn - ScrollX) * fe.MaxXAdvance;
-// gr.MoveTo (0.5 + cursorX, cb.Y + printedCurrentLine * (fe.Ascent+fe.Descent));
-// gr.LineTo (0.5 + cursorX, cb.Y + (printedCurrentLine + 1) * (fe.Ascent+fe.Descent));
-// gr.Stroke();
-// }
-// #endregion
-//
-// for (int i = 0; i < PrintedLines.Count; i++)
-// drawTokenLine (gr, i, selectionInProgress, cb);
-//
-// gr.Restore ();
-// }
- void drawRawCodeLine(Context gr, double x, double y, int i, int lineIndex) {
- string lstr = buffer[lineIndex].PrintableContent;
- if (ScrollX < lstr.Length)
- lstr = lstr.Substring (ScrollX);
- else
- lstr = "";
-
- gr.MoveTo (x, y + fe.Ascent);
- gr.ShowText (lstr);
- gr.Fill ();
-
- if (!buffer.SelectionIsEmpty && lineIndex >= buffer.SelectionStart.Y && lineIndex <= buffer.SelectionEnd.Y) {
- double rLineX = x,
- rLineY = y,
- rLineW = lstr.Length * fe.MaxXAdvance;
-
- //System.Diagnostics.Debug.WriteLine ("sel start: " + buffer.SelectionStart + " sel end: " + buffer.SelectionEnd);
- if (lineIndex == buffer.SelectionStart.Y) {
- rLineX += (selStartCol - ScrollX) * fe.MaxXAdvance;
- rLineW -= selStartCol * fe.MaxXAdvance;
- }
- if (lineIndex == buffer.SelectionEnd.Y)
- rLineW -= (lstr.Length - selEndCol) * fe.MaxXAdvance;
-
- gr.Save ();
- gr.Operator = Operator.Source;
- gr.Rectangle (rLineX, rLineY, rLineW, (fe.Ascent+fe.Descent));
- gr.SetSourceColor (SelectionBackground);
- gr.FillPreserve ();
- gr.Clip ();
- gr.Operator = Operator.Over;
- gr.SetSourceColor (SelectionForeground);
- gr.MoveTo (x, y + fe.Ascent);
- gr.ShowText (lstr);
- gr.Fill ();
- gr.Restore ();
- }
- }
- void drawParsedCodeLine (Context gr, double x, double y, int i, int lineIndex) {
- int lPtr = 0;
- CodeLine cl = PrintedLines[i];
-
- for (int t = 0; t < cl.Tokens.Count; t++) {
- string lstr = cl.Tokens [t].PrintableContent;
- if (lPtr < ScrollX) {
- if (lPtr - ScrollX + lstr.Length <= 0) {
- lPtr += lstr.Length;
- continue;
- }
- lstr = lstr.Substring (ScrollX - lPtr);
- lPtr += ScrollX - lPtr;
- }
- Color bg = this.Background;
- Color fg = this.Foreground;
- Color selbg = this.SelectionBackground;
- Color selfg = this.SelectionForeground;
- FontSlant fts = FontSlant.Normal;
- FontWeight ftw = FontWeight.Normal;
-
- if (formatting.ContainsKey ((int)cl.Tokens [t].Type)) {
- TextFormatting tf = formatting [(int)cl.Tokens [t].Type];
- bg = tf.Background;
- fg = tf.Foreground;
- if (tf.Bold)
- ftw = FontWeight.Bold;
- if (tf.Italic)
- fts = FontSlant.Italic;
- }
-
- gr.SelectFontFace (Font.Name, fts, ftw);
- gr.SetSourceColor (fg);
-
- gr.MoveTo (x, y + fe.Ascent);
- gr.ShowText (lstr);
- gr.Fill ();
-
- if (buffer.SelectionInProgress && lineIndex >= buffer.SelectionStart.Y && lineIndex <= buffer.SelectionEnd.Y &&
- !(lineIndex == buffer.SelectionStart.Y && lPtr + lstr.Length <= selStartCol) &&
- !(lineIndex == buffer.SelectionEnd.Y && selEndCol <= lPtr)) {
-
- double rLineX = x,
- rLineY = y,
- rLineW = lstr.Length * fe.MaxXAdvance;
- double startAdjust = 0.0;
-
- if ((lineIndex == buffer.SelectionStart.Y) && (selStartCol < lPtr + lstr.Length) && (selStartCol > lPtr))
- startAdjust = (selStartCol - lPtr) * fe.MaxXAdvance;
- rLineX += startAdjust;
- if ((lineIndex == buffer.SelectionEnd.Y) && (selEndCol < lPtr + lstr.Length))
- rLineW = (selEndCol - lPtr) * fe.MaxXAdvance;
- rLineW -= startAdjust;
-
- gr.Save ();
- gr.Operator = Operator.Source;
- gr.Rectangle (rLineX, rLineY, rLineW, (fe.Ascent+fe.Descent));
- gr.SetSourceColor (selbg);
- gr.FillPreserve ();
- gr.Clip ();
- gr.Operator = Operator.Over;
- gr.SetSourceColor (selfg);
- gr.MoveTo (x, y + fe.Ascent);
- gr.ShowText (lstr);
- gr.Fill ();
- gr.Restore ();
- }
- x += (int)lstr.Length * fe.MaxXAdvance;
- lPtr += lstr.Length;
- }
- }
-
- #endregion
-
- #region GraphicObject overrides
- public override Font Font {
- get { return base.Font; }
- set {
- base.Font = value;
-
- using (ImageSurface img = new ImageSurface (Format.Argb32, 1, 1)) {
- using (Context gr = new Context (img)) {
- gr.SelectFontFace (Font.Name, Font.Slant, Font.Wheight);
- gr.SetFontSize (Font.Size);
-
- fe = gr.FontExtents;
- }
- }
- MaxScrollY = 0;
- RegisterForGraphicUpdate ();
- }
- }
- protected override int measureRawSize(LayoutingType lt)
- {
- if (lt == LayoutingType.Height)
- return (int)Math.Ceiling((fe.Ascent+fe.Descent) * buffer.LineCount) + Margin * 2;
-
- return (int)(fe.MaxXAdvance * buffer.longestLineCharCount) + Margin * 2 + leftMargin;
- }
- public override void OnLayoutChanges (LayoutingType layoutType)
- {
- base.OnLayoutChanges (layoutType);
-
- if (layoutType == LayoutingType.Height)
- updateVisibleLines ();
- else if (layoutType == LayoutingType.Width)
- updateVisibleColumns ();
- }
-
- protected override void onDraw (Context gr)
- {
- base.onDraw (gr);
-
- gr.SelectFontFace (Font.Name, Font.Slant, Font.Wheight);
- gr.SetFontSize (Font.Size);
- gr.FontOptions = Interface.FontRenderingOptions;
- gr.Antialias = Interface.Antialias;
-
- Rectangle cb = ClientRectangle;
-
- Foreground.SetAsSource (gr);
-
- buffer.editMutex.EnterReadLock ();
- editorMutex.EnterReadLock ();
-
- #region draw text cursor
- if (buffer.SelectionInProgress){
- selStartCol = getTabulatedColumn (buffer.SelectionStart);
- selEndCol = getTabulatedColumn (buffer.SelectionEnd);
- }else if (HasFocus && printedCurrentLine >= 0){
- gr.LineWidth = 1.0;
- double cursorX = cb.X + (getTabulatedColumn(buffer.CurrentPosition) - ScrollX) * fe.MaxXAdvance + leftMargin;
- gr.MoveTo (0.5 + cursorX, cb.Y + (printedCurrentLine) * (fe.Ascent+fe.Descent));
- gr.LineTo (0.5 + cursorX, cb.Y + (printedCurrentLine + 1) * (fe.Ascent+fe.Descent));
- gr.Stroke();
- }
- #endregion
-
- if (PrintedLines?.Count > 0) {
- int unfoldedLines = buffer.UnfoldedLines;
- currentNode = null;
- CodeLine cl = PrintedLines[0];
- int idx0 = buffer.IndexOf(cl);
- int li = idx0-1;
- while (li >= 0) {
- if (buffer [li].IsFoldable && !buffer [li].IsFolded) {
- if (buffer.IndexOf(buffer [li].SyntacticNode.EndLine) > idx0){
- currentNode = buffer [li].SyntacticNode;
- break;
- }
- }
- li--;
- }
-
- for (int i = 0; i < visibleLines; i++) {
- if (i + ScrollY >= unfoldedLines)//TODO:need optimize
- break;
- drawLine (gr, cb, i);
- }
- }
-
- editorMutex.ExitReadLock ();
-
- buffer.editMutex.ExitReadLock ();
-
- }
- #endregion
-
- #region Mouse handling
-
- int hoverLine = -1;
- public int HoverLine {
- get { return hoverLine; }
- set {
- if (hoverLine == value)
- return;
- hoverLine = value;
- NotifyValueChanged ("HoverLine", hoverLine);
- }
- }
- void updateHoverLine () {
- int hvl = (int)Math.Max (0, Math.Floor (mouseLocalPos.Y / (fe.Ascent+fe.Descent)));
- hvl = Math.Min (PrintedLines.Count, hvl);
- HoverLine = buffer.IndexOf (PrintedLines[hvl]);
- }
- void updateCurrentPosFromMouseLocalPos(){
- PrintedCurrentLine = (int)Math.Max (0, Math.Floor (mouseLocalPos.Y / (fe.Ascent+fe.Descent)));
- int curVisualCol = ScrollX + (int)Math.Round ((mouseLocalPos.X - leftMargin) / fe.MaxXAdvance);
-
- int i = 0;
- int buffCol = 0;
- while (i < curVisualCol && buffCol < buffer.CurrentCodeLine.Length) {
- if (buffer.CurrentCodeLine[buffCol] == '\t')
- i += Interface.TabSize;
- else
- i++;
- buffCol++;
- }
- buffer.CurrentColumn = buffCol;
- }
- public override void onMouseEnter (object sender, MouseMoveEventArgs e)
- {
- base.onMouseEnter (sender, e);
- if (e.X - ScreenCoordinates(Slot).X < leftMargin + ClientRectangle.X)
- IFace.MouseCursor = XCursor.Default;
- else
- IFace.MouseCursor = XCursor.Text;
- }
- public override void onMouseLeave (object sender, MouseMoveEventArgs e)
- {
- base.onMouseLeave (sender, e);
- IFace.MouseCursor = XCursor.Default;
- }
- public override void onMouseMove (object sender, MouseMoveEventArgs e)
- {
- base.onMouseMove (sender, e);
-
- mouseLocalPos = e.Position - ScreenCoordinates(Slot).TopLeft - ClientRectangle.TopLeft;
-
- updateHoverLine ();
-
- if (!e.Mouse.IsButtonDown (MouseButton.Left)) {
- if (mouseLocalPos.X < leftMargin)
- IFace.MouseCursor = XCursor.Default;
- else
- IFace.MouseCursor = XCursor.Text;
- return;
- }
-
- if (!HasFocus || !buffer.SelectionInProgress)
- return;
-
- //mouse is down
- updateCurrentPosFromMouseLocalPos();
- buffer.SetSelEndPos ();
- }
- public override void onMouseDown (object sender, MouseButtonEventArgs e)
- {
- if (!this.Focusable)
- return;
-
- if (mouseLocalPos.X >= leftMargin)
- base.onMouseDown (sender, e);
-
- if (doubleClicked) {
- doubleClicked = false;
- return;
- }
-
- if (mouseLocalPos.X < leftMargin) {
- toogleFolding (buffer.IndexOf (PrintedLines [(int)Math.Max (0, Math.Floor (mouseLocalPos.Y / (fe.Ascent+fe.Descent)))]));
- return;
- }
-
- updateCurrentPosFromMouseLocalPos ();
- buffer.SetSelStartPos ();
- }
- public override void onMouseUp (object sender, MouseButtonEventArgs e)
- {
- base.onMouseUp (sender, e);
-
- if (buffer.SelectionIsEmpty)
- buffer.ResetSelection ();
- }
-
- public override void onMouseDoubleClick (object sender, MouseButtonEventArgs e)
- {
- doubleClicked = true;
- base.onMouseDoubleClick (sender, e);
-
- buffer.GotoWordStart ();
- buffer.SetSelStartPos ();
- buffer.GotoWordEnd ();
- buffer.SetSelEndPos ();
- }
-
- public override void onMouseWheel (object sender, MouseWheelEventArgs e)
- {
- base.onMouseWheel (sender, e);
- }
- #endregion
-
- #region Keyboard handling
- public override void onKeyDown (object sender, KeyboardKeyEventArgs e)
- {
- //base.onKeyDown (sender, e);
-
- Key key = e.Key;
-
- if (e.Control) {
- switch (key) {
- case Key.S:
- projFile.Save ();
- break;
- case Key.W:
- editorMutex.EnterWriteLock ();
- if (e.Shift)
- projFile.Redo (null);
- else
- projFile.Undo (null);
- editorMutex.ExitWriteLock ();
- break;
- default:
- Console.WriteLine ("");
- break;
- }
- }
-
- switch (key)
- {
- case Key.Back:
- buffer.DeleteChar ();
- break;
- case Key.Clear:
- break;
- case Key.Delete:
- if (buffer.SelectionIsEmpty)
- MoveRight ();
- else if (e.Shift)
- IFace.Clipboard = buffer.SelectedText;
- buffer.DeleteChar ();
- break;
- case Key.Enter:
- case Key.KeypadEnter:
- if (!buffer.SelectionIsEmpty)
- buffer.DeleteChar ();
- buffer.InsertLineBreak ();
- break;
- case Key.Escape:
- buffer.ResetSelection ();
- break;
- case Key.Home:
- if (e.Shift) {
- if (buffer.SelectionIsEmpty)
- buffer.SetSelStartPos ();
- if (e.Control)
- buffer.CurrentLine = 0;
- buffer.CurrentColumn = 0;
- buffer.SetSelEndPos ();
- break;
- }
- buffer.ResetSelection ();
- if (e.Control)
- buffer.CurrentLine = 0;
- buffer.CurrentColumn = 0;
- break;
- case Key.End:
- if (e.Shift) {
- if (buffer.SelectionIsEmpty)
- buffer.SetSelStartPos ();
- if (e.Control)
- buffer.CurrentLine = int.MaxValue;
- buffer.CurrentColumn = int.MaxValue;
- buffer.SetSelEndPos ();
- break;
- }
- buffer.ResetSelection ();
- if (e.Control)
- buffer.CurrentLine = int.MaxValue;
- buffer.CurrentColumn = int.MaxValue;
- break;
- case Key.Insert:
- if (e.Shift)
- buffer.Insert (IFace.Clipboard);
- else if (e.Control && !buffer.SelectionIsEmpty)
- IFace.Clipboard = buffer.SelectedText;
- break;
- case Key.Left:
- if (e.Shift) {
- if (buffer.SelectionIsEmpty)
- buffer.SetSelStartPos ();
- if (e.Control)
- buffer.GotoWordStart ();
- else
- MoveLeft ();
- buffer.SetSelEndPos ();
- break;
- }
- buffer.ResetSelection ();
- if (e.Control)
- buffer.GotoWordStart ();
- else
- MoveLeft();
- break;
- case Key.Right:
- if (e.Shift) {
- if (buffer.SelectionIsEmpty)
- buffer.SetSelStartPos ();
- if (e.Control)
- buffer.GotoWordEnd ();
- else
- MoveRight ();
- buffer.SetSelEndPos ();
- break;
- }
- buffer.ResetSelection ();
- if (e.Control)
- buffer.GotoWordEnd ();
- else
- MoveRight ();
- break;
- case Key.Up:
- if (e.Shift) {
- if (buffer.SelectionIsEmpty)
- buffer.SetSelStartPos ();
- PrintedCurrentLine--;
- buffer.SetSelEndPos ();
- break;
- }
- buffer.ResetSelection ();
- PrintedCurrentLine--;
- break;
- case Key.Down:
- if (e.Shift) {
- if (buffer.SelectionIsEmpty)
- buffer.SetSelStartPos ();
- PrintedCurrentLine++;
- buffer.SetSelEndPos ();
- break;
- }
- buffer.ResetSelection ();
- PrintedCurrentLine++;
- break;
- case Key.Menu:
- break;
- case Key.NumLock:
- break;
- case Key.PageDown:
- if (e.Shift) {
- if (buffer.SelectionIsEmpty)
- buffer.SetSelStartPos ();
- PrintedCurrentLine += visibleLines;
- buffer.SetSelEndPos ();
- break;
- }
- buffer.ResetSelection ();
- PrintedCurrentLine += visibleLines;
- break;
- case Key.PageUp:
- if (e.Shift) {
- if (buffer.SelectionIsEmpty)
- buffer.SetSelStartPos ();
- PrintedCurrentLine -= visibleLines;
- buffer.SetSelEndPos ();
- break;
- }
- buffer.ResetSelection ();
- PrintedCurrentLine -= visibleLines;
- break;
- case Key.RWin:
- break;
- case Key.Tab:
- if (e.Shift) {
- if (buffer.SelectionIsEmpty ||
- (buffer.SelectionStart.Y == buffer.SelectionEnd.Y)) {
- //TODO
- break;
- }
- for (int i = buffer.SelectionStart.Y; i <= buffer.SelectionEnd.Y; i++)
- buffer.RemoveLeadingTab (i);
- buffer.SetSelectionOnFullLines ();
- } else {
- if (buffer.SelectionIsEmpty ||
- (buffer.SelectionStart.Y == buffer.SelectionEnd.Y)) {
- buffer.Insert ("\t");
- break;
- }
- for (int i = buffer.SelectionStart.Y; i <= buffer.SelectionEnd.Y; i++) {
- buffer.UpdateLine (i, "\t" + buffer [i].Content);
- }
- }
-
- break;
- case Key.F8:
- toogleFolding (buffer.CurrentLine);
- break;
- default:
- break;
- }
- RegisterForGraphicUpdate();
- }
- public override void onKeyPress (object sender, KeyPressEventArgs e)
- {
- base.onKeyPress (sender, e);
-
- buffer.Insert (e.KeyChar.ToString());
- buffer.ResetSelection ();
- }
- #endregion
- }
-}
\ No newline at end of file
--- /dev/null
+//
+// ScrollingTextBox.cs
+//
+// Author:
+// Jean-Philippe Bruyère <jp.bruyere@hotmail.com>
+//
+// Copyright (c) 2013-2017 Jean-Philippe Bruyère
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using System.Xml.Serialization;
+using System.ComponentModel;
+using System.Collections;
+using Cairo;
+using System.Text;
+using System.Collections.Generic;
+using System.Text.RegularExpressions;
+using System.Linq;
+using System.Diagnostics;
+using System.IO;
+using System.Threading;
+
+namespace Crow.Coding
+{
+ /// <summary>
+ /// Scrolling text box optimized for monospace fonts, for coding
+ /// </summary>
+ public class SourceEditor : Editor
+ {
+ #region CTOR
+ public SourceEditor (): base()
+ {
+ formatting.Add ((int)XMLParser.TokenType.AttributeName, new TextFormatting (Color.DarkSlateGray, Color.Transparent));
+ formatting.Add ((int)XMLParser.TokenType.ElementName, new TextFormatting (Color.DarkBlue, Color.Transparent));
+ formatting.Add ((int)XMLParser.TokenType.ElementStart, new TextFormatting (Color.Black, Color.Transparent));
+ formatting.Add ((int)XMLParser.TokenType.ElementEnd, new TextFormatting (Color.Black, Color.Transparent));
+ formatting.Add ((int)XMLParser.TokenType.ElementClosing, new TextFormatting (Color.Black, Color.Transparent));
+
+ formatting.Add ((int)XMLParser.TokenType.AttributeValueOpening, new TextFormatting (Color.Crimson, Color.Transparent));
+ formatting.Add ((int)XMLParser.TokenType.AttributeValueClosing, new TextFormatting (Color.Crimson, Color.Transparent));
+ formatting.Add ((int)XMLParser.TokenType.AttributeValue, new TextFormatting (Color.FireBrick, Color.Transparent, false, true));
+ formatting.Add ((int)XMLParser.TokenType.XMLDecl, new TextFormatting (Color.ForestGreen, Color.Transparent));
+
+ formatting.Add ((int)BufferParser.TokenType.BlockComment, new TextFormatting (Color.Gray, Color.Transparent, false, true));
+ formatting.Add ((int)BufferParser.TokenType.LineComment, new TextFormatting (Color.Gray, Color.Transparent, false, true));
+ formatting.Add ((int)BufferParser.TokenType.OperatorOrPunctuation, new TextFormatting (Color.Black, Color.Transparent));
+ formatting.Add ((int)BufferParser.TokenType.Keyword, new TextFormatting (Color.Teal, Color.Transparent));
+ //formatting.Add ((int)BufferParser.TokenType.Keyword, new TextFormatting (Color.DarkCyan, Color.Transparent));
+
+ parsing.Add (".crow", "Crow.Coding.XMLParser");
+ parsing.Add (".svg", "Crow.Coding.XMLParser");
+ parsing.Add (".template", "Crow.Coding.XMLParser");
+ parsing.Add (".cs", "Crow.Coding.CSharpParser");
+ parsing.Add (".style", "Crow.Coding.StyleParser");
+
+ buffer = new CodeBuffer ();
+ buffer.LineUpadateEvent += Buffer_LineUpadateEvent;
+ buffer.LineAdditionEvent += Buffer_LineAdditionEvent;;
+ buffer.LineRemoveEvent += Buffer_LineRemoveEvent;
+ buffer.BufferCleared += Buffer_BufferCleared;
+ buffer.SelectionChanged += Buffer_SelectionChanged;
+ buffer.PositionChanged += Buffer_PositionChanged;
+ buffer.FoldingEvent += Buffer_FoldingEvent;
+ buffer.Add (new CodeLine(""));
+ }
+ #endregion
+
+ string oldSource = "";
+ //save requested position on error, and try it on next move
+ int requestedLine = 0, requestedCol = 0;
+ volatile bool isDirty = false;
+
+ const int leftMarginGap = 10;//gap between items in margin and text
+ const int foldSize = 9;//folding rectangles size
+ const int foldHSpace = 4;//folding level tabulation x
+ int foldMargin { get { return parser == null ? 0 : parser.SyntacticTreeMaxDepth * foldHSpace; }}//folding margin size
+
+ #region private and protected fields
+ bool foldingEnabled = true;
+ int leftMargin = 0; //margin used to display line numbers, folding errors,etc...
+ int visibleLines = 1;
+ int visibleColumns = 1;
+ int firstPrintedLine = -1;
+ int printedCurrentLine = 0;//Index of the currentline in the PrintedLines array
+
+ CodeBuffer buffer;
+ BufferParser parser;
+ List<CodeLine> PrintedLines;//list of lines visible in the Editor depending on scrolling and folding
+
+ Dictionary<int, TextFormatting> formatting = new Dictionary<int, TextFormatting>();
+ Dictionary<string, string> parsing = new Dictionary<string, string>();
+
+ Color selBackground;
+ Color selForeground;
+ int selStartCol;
+ int selEndCol;
+
+ protected Rectangle rText;
+ protected FontExtents fe;
+ protected TextExtents te;
+
+ Point mouseLocalPos;
+ bool doubleClicked = false;
+ #endregion
+
+ void measureLeftMargin () {
+ leftMargin = 0;
+ if (PrintLineNumbers)
+ leftMargin += (int)Math.Ceiling((double)buffer.LineCount.ToString().Length * fe.MaxXAdvance) +6;
+ if (foldingEnabled)
+ leftMargin += foldMargin;
+ if (leftMargin > 0)
+ leftMargin += leftMarginGap;
+ updateVisibleColumns ();
+ }
+ void findLongestLineAndUpdateMaxScrollX() {
+ buffer.FindLongestVisualLine ();
+ updateMaxScrollX ();
+// Debug.WriteLine ("SourceEditor: Find Longest line and update maxscrollx: {0} visible cols:{1}", MaxScrollX, visibleColumns);
+ }
+ /// <summary>
+ /// Updates visible line in widget, adapt max scroll y and updatePrintedLines
+ /// </summary>
+ void updateVisibleLines(){
+ visibleLines = (int)Math.Floor ((double)ClientRectangle.Height / (fe.Ascent+fe.Descent));
+ NotifyValueChanged ("VisibleLines", visibleLines);
+ updateMaxScrollY ();
+ updatePrintedLines ();
+ RegisterForGraphicUpdate ();
+// System.Diagnostics.Debug.WriteLine ("update visible lines: " + visibleLines);
+// System.Diagnostics.Debug.WriteLine ("update MaxScrollY: " + MaxScrollY);
+ }
+ void updateVisibleColumns(){
+ visibleColumns = (int)Math.Floor ((double)(ClientRectangle.Width - leftMargin)/ fe.MaxXAdvance);
+ NotifyValueChanged ("VisibleColumns", visibleColumns);
+ updateMaxScrollX ();
+// System.Diagnostics.Debug.WriteLine ("update visible columns: {0} leftMargin:{1}",visibleColumns, leftMargin);
+// System.Diagnostics.Debug.WriteLine ("update MaxScrollX: " + MaxScrollX);
+ }
+ void updateMaxScrollX () {
+ MaxScrollX = Math.Max (0, buffer.longestLineCharCount - visibleColumns);
+ if (buffer.longestLineCharCount > 0)
+ NotifyValueChanged ("ChildWidthRatio", Slot.Width * visibleColumns / buffer.longestLineCharCount);
+ }
+ void updateMaxScrollY () {
+ if (parser == null || !foldingEnabled) {
+ MaxScrollY = Math.Max (0, buffer.LineCount - visibleLines);
+ if (buffer.UnfoldedLines > 0)
+ NotifyValueChanged ("ChildHeightRatio", Slot.Height * visibleLines / buffer.UnfoldedLines);
+ } else {
+ MaxScrollY = Math.Max (0, buffer.UnfoldedLines - visibleLines);
+ if (buffer.UnfoldedLines > 0)
+ NotifyValueChanged ("ChildHeightRatio", Slot.Height * visibleLines / buffer.UnfoldedLines);
+ }
+ }
+ void updatePrintedLines () {
+ buffer.editMutex.EnterReadLock ();
+ editorMutex.EnterWriteLock ();
+
+ PrintedLines = new List<CodeLine> ();
+ int curL = 0;
+ int i = 0;
+
+ while (curL < buffer.LineCount && i < ScrollY) {
+ if (buffer [curL].IsFolded)
+ curL = buffer.GetEndNodeIndex (curL);
+ curL++;
+ i++;
+ }
+
+ firstPrintedLine = curL;
+ i = 0;
+ while (i < visibleLines && curL < buffer.LineCount) {
+ PrintedLines.Add (buffer [curL]);
+
+ if (buffer [curL].IsFolded)
+ curL = buffer.GetEndNodeIndex (curL);
+
+ curL++;
+ i++;
+ }
+
+ buffer.editMutex.ExitReadLock ();
+ editorMutex.ExitWriteLock ();
+ }
+ void updateOnScreenCurLineFromBuffCurLine(){
+ printedCurrentLine = PrintedLines.IndexOf (buffer.CurrentCodeLine);
+ }
+ void toogleFolding (int line) {
+ if (parser == null || !foldingEnabled)
+ return;
+ buffer.ToogleFolding (line);
+ }
+
+ #region Editor overrides
+ protected override void updateEditorFromProjFile ()
+ {
+ Debug.WriteLine("\t\tSourceEditor updateEditorFromProjFile");
+
+ buffer.editMutex.EnterWriteLock ();
+ loadSource ();
+ buffer.editMutex.ExitWriteLock ();
+
+ isDirty = false;
+ oldSource = projFile.Source;
+ CurrentLine = requestedLine;
+ CurrentColumn = requestedCol;
+ projFile.RegisteredEditors [this] = true;
+ }
+ protected override void updateProjFileFromEditor ()
+ {
+ Debug.WriteLine("\t\tSourceEditor updateProjFileFromEditor");
+
+ buffer.editMutex.EnterWriteLock ();
+ string newsrc = buffer.FullText;
+ buffer.editMutex.ExitWriteLock ();
+ projFile.UpdateSource (this, newsrc);
+ }
+ protected override bool EditorIsDirty {
+ get { return isDirty; }
+ set { isDirty = value; }
+ }
+ protected override bool IsReady {
+ get { return projFile != null && buffer != null; }
+ }
+ #endregion
+
+ #region Buffer events handlers
+ void Buffer_BufferCleared (object sender, EventArgs e)
+ {
+ editorMutex.EnterWriteLock ();
+
+ buffer.longestLineCharCount = 0;
+ buffer.longestLineIdx = 0;
+ measureLeftMargin ();
+ MaxScrollX = MaxScrollY = 0;
+ PrintedLines = null;
+ RegisterForGraphicUpdate ();
+ notifyPositionChanged ();
+ isDirty = true;
+
+ editorMutex.ExitWriteLock ();
+ }
+ void Buffer_LineAdditionEvent (object sender, CodeBufferEventArgs e)
+ {
+ for (int i = 0; i < e.LineCount; i++) {
+ int lptr = e.LineStart + i;
+ int charCount = buffer[lptr].PrintableLength;
+ if (charCount > buffer.longestLineCharCount) {
+ buffer.longestLineIdx = lptr;
+ buffer.longestLineCharCount = charCount;
+ }else if (lptr <= buffer.longestLineIdx)
+ buffer.longestLineIdx++;
+ if (parser == null)
+ continue;
+ parser.TryParseBufferLine (e.LineStart + i);
+ }
+
+ if (parser != null)
+ parser.reparseSource ();
+
+ measureLeftMargin ();
+
+ updatePrintedLines ();
+ updateMaxScrollY ();
+ RegisterForGraphicUpdate ();
+ notifyPositionChanged ();
+ isDirty = true;
+ }
+ void Buffer_LineRemoveEvent (object sender, CodeBufferEventArgs e)
+ {
+ bool trigFindLongestLine = false;
+ for (int i = 0; i < e.LineCount; i++) {
+ int lptr = e.LineStart + i;
+ if (lptr <= buffer.longestLineIdx)
+ trigFindLongestLine = true;
+ }
+ if (trigFindLongestLine)
+ findLongestLineAndUpdateMaxScrollX ();
+
+ measureLeftMargin ();
+ updatePrintedLines ();
+ updateMaxScrollY ();
+ RegisterForGraphicUpdate ();
+ notifyPositionChanged ();
+ isDirty = true;
+ }
+ void Buffer_LineUpadateEvent (object sender, CodeBufferEventArgs e)
+ {
+ bool trigFindLongestLine = false;
+ for (int i = 0; i < e.LineCount; i++) {
+
+ int lptr = e.LineStart + i;
+ if (lptr == buffer.longestLineIdx)
+ trigFindLongestLine = true;
+ else if (buffer[lptr].PrintableLength > buffer.longestLineCharCount) {
+ buffer.longestLineCharCount = buffer[lptr].PrintableLength;
+ buffer.longestLineIdx = lptr;
+ }
+ }
+ if (trigFindLongestLine)
+ findLongestLineAndUpdateMaxScrollX ();
+
+ RegisterForGraphicUpdate ();
+ notifyPositionChanged ();
+ isDirty = true;
+ }
+ void Buffer_PositionChanged (object sender, EventArgs e)
+ {
+ Console.WriteLine ("Position changes: ({0},{1})", buffer.CurrentLine, buffer.CurrentColumn);
+ int cc = buffer.CurrentTabulatedColumn;
+
+ if (cc > visibleColumns + ScrollX) {
+ ScrollX = cc - visibleColumns;
+ } else if (cc < ScrollX)
+ ScrollX = cc;
+
+ RegisterForGraphicUpdate ();
+ updateOnScreenCurLineFromBuffCurLine ();
+ notifyPositionChanged ();
+ }
+
+ void Buffer_SelectionChanged (object sender, EventArgs e)
+ {
+ RegisterForGraphicUpdate ();
+ }
+ void Buffer_FoldingEvent (object sender, CodeBufferEventArgs e)
+ {
+ updatePrintedLines ();
+ updateOnScreenCurLineFromBuffCurLine ();
+ updateMaxScrollY ();
+ RegisterForGraphicUpdate ();
+ }
+ #endregion
+
+ void notifyPositionChanged (){
+ try {
+ NotifyValueChanged ("CurrentLine", buffer.CurrentLine+1);
+ NotifyValueChanged ("CurrentColumn", buffer.CurrentColumn+1);
+ NotifyValueChanged ("CurrentLineHasError", CurrentLineHasError);
+ NotifyValueChanged ("CurrentLineError", CurrentLineError);
+ } catch (Exception ex) {
+ Console.WriteLine (ex.ToString ());
+ }
+ }
+
+ #region Public Crow Properties
+ public int CurrentLine{
+ get { return buffer == null ? 0 : buffer.CurrentLine+1; }
+ set {
+ try {
+ int l = value - 1;
+ if (l == buffer.CurrentLine)
+ return;
+ buffer.CurrentLine = l;
+ if ((bool)buffer [l]?.IsFolded)
+ buffer.ToogleFolding (l);
+ } catch (Exception ex) {
+ requestedLine = value - 1;
+ Console.WriteLine ("Error cur column: " + ex.ToString ());
+ }
+ }
+ }
+ public int CurrentColumn{
+ get { return buffer == null ? 0 : buffer.CurrentColumn+1; }
+ set {
+ try {
+ if (value - 1 == buffer.CurrentColumn)
+ return;
+ buffer.CurrentColumn = value - 1;
+ } catch (Exception ex) {
+ requestedCol = value - 1;
+ Console.WriteLine ("Error cur column: " + ex.ToString ());
+ }
+ }
+ }
+ public bool PrintLineNumbers
+ {
+ get { return Configuration.Global.Get<bool> ("PrintLineNumbers"); }
+ set {
+ if (PrintLineNumbers == value)
+ return;
+ Configuration.Global.Set ("PrintLineNumbers", value);
+ NotifyValueChanged ("PrintLineNumbers", PrintLineNumbers);
+ measureLeftMargin ();
+ RegisterForGraphicUpdate ();
+ }
+ }
+ [DefaultValue("SteelBlue")]
+ public virtual Color SelectionBackground {
+ get { return selBackground; }
+ set {
+ if (value == selBackground)
+ return;
+ selBackground = value;
+ NotifyValueChanged ("SelectionBackground", selBackground);
+ RegisterForRedraw ();
+ }
+ }
+ [DefaultValue("White")]
+ public virtual Color SelectionForeground {
+ get { return selForeground; }
+ set {
+ if (value == selForeground)
+ return;
+ selForeground = value;
+ NotifyValueChanged ("SelectionForeground", selForeground);
+ RegisterForRedraw ();
+ }
+ }
+ public override int ScrollY {
+ get {
+ return base.ScrollY;
+ }
+ set {
+ if (value == base.ScrollY)
+ return;
+ base.ScrollY = value;
+ updatePrintedLines ();
+ updateOnScreenCurLineFromBuffCurLine ();
+ RegisterForGraphicUpdate ();
+ }
+ }
+ public ParserException CurrentLineError {
+ get { return buffer?.CurrentCodeLine?.exception; }
+ }
+ public bool CurrentLineHasError {
+ get { return buffer == null ? false : buffer.CurrentCodeLine == null ? false :
+ buffer.CurrentCodeLine.exception != null; }
+ }
+ public override ProjectFile ProjectNode {
+ get {
+ return base.ProjectNode;
+ }
+ set {
+ base.ProjectNode = value;
+ if (projFile != null)
+ parser = getParserFromExt (System.IO.Path.GetExtension (projFile.Extension));
+ }
+ }
+ #endregion
+
+ BufferParser getParserFromExt (string extension) {
+ if (string.IsNullOrEmpty(extension))
+ return null;
+ if (!parsing.ContainsKey(extension))
+ return null;
+ Type parserType = Type.GetType (parsing [extension]);
+ if (parserType == null)
+ return null;
+ return (BufferParser)Activator.CreateInstance (parserType, buffer );
+ }
+ void loadSource () {
+
+ try {
+
+ if (parser == null)
+ buffer.Load (projFile.Source);
+ else//parser may have special linebrk rules
+ buffer.Load (projFile.Source, parser.LineBrkRegex);
+
+ } catch (Exception ex) {
+ Debug.WriteLine (ex.ToString ());
+ }
+
+ projFile.RegisteredEditors [this] = true;
+
+ updateMaxScrollY ();
+ MaxScrollX = Math.Max (0, buffer.longestLineCharCount - visibleColumns);
+ updatePrintedLines ();
+
+ RegisterForGraphicUpdate ();
+ }
+
+ /// <summary>
+ /// Current editor line, when set, update buffer.CurrentLine
+ /// </summary>
+ int PrintedCurrentLine {
+ get { return printedCurrentLine;}
+ set {
+ if (value < 0) {
+ ScrollY += value;
+ printedCurrentLine = 0;
+ } else if (PrintedLines.Count < visibleLines && value >= PrintedLines.Count) {
+ printedCurrentLine = PrintedLines.Count - 1;
+ }else if (value >= visibleLines) {
+ ScrollY += value - visibleLines + 1;
+ printedCurrentLine = visibleLines - 1;
+ }else
+ printedCurrentLine = value;
+ //Debug.WriteLine ("printed current line:" + printedCurrentLine.ToString ());
+ //update position in buffer
+ buffer.CurrentLine = buffer.IndexOf (PrintedLines[printedCurrentLine]);
+ }
+ }
+ int getTabulatedColumn (int col, int line) {
+ return buffer [line].Content.Substring (0, col).Replace ("\t", new String (' ', Interface.TabSize)).Length;
+ }
+ int getTabulatedColumn (Point pos) {
+ return getTabulatedColumn (pos.X,pos.Y);
+ }
+ /// <summary>
+ /// Moves cursor one char to the left, move up if cursor reaches start of line
+ /// </summary>
+ /// <returns><c>true</c> if move succeed</returns>
+ public bool MoveLeft(){
+ if (buffer.CurrentColumn == 0) {
+ if (printedCurrentLine == 0)
+ return false;
+ PrintedCurrentLine--;
+ buffer.CurrentColumn = int.MaxValue;
+ } else
+ buffer.CurrentColumn--;
+ return true;
+ }
+ /// <summary>
+ /// Moves cursor one char to the right, move down if cursor reaches end of line
+ /// </summary>
+ /// <returns><c>true</c> if move succeed</returns>
+ public bool MoveRight(){
+ if (buffer.CurrentColumn >= buffer.CurrentCodeLine.Length) {
+ if (PrintedCurrentLine == buffer.UnfoldedLines - 1)
+ return false;
+ buffer.CurrentColumn = 0;
+ PrintedCurrentLine++;
+ } else
+ buffer.CurrentColumn++;
+ return true;
+ }
+
+ #region Drawing
+ void drawLine(Context gr, Rectangle cb, int i) {
+ CodeLine cl = PrintedLines[i];
+ int lineIndex = buffer.IndexOf(cl);
+
+ double y = cb.Y + (fe.Ascent+fe.Descent) * i, x = cb.X;
+
+ //Draw line numbering
+ Color mgFg = Color.Gray;
+ Color mgBg = Color.White;
+ if (PrintLineNumbers){
+ Rectangle mgR = new Rectangle ((int)x, (int)y, leftMargin - leftMarginGap, (int)Math.Ceiling((fe.Ascent+fe.Descent)));
+ if (cl.exception != null) {
+ mgBg = Color.Red;
+ if (buffer.CurrentLine == lineIndex)
+ mgFg = Color.White;
+ else
+ mgFg = Color.LightGray;
+ }else if (buffer.CurrentLine == lineIndex) {
+ mgFg = Color.Black;
+ mgBg = Color.DarkGray;
+ }
+ string strLN = (lineIndex+1).ToString ();
+ gr.SetSourceColor (mgBg);
+ gr.Rectangle (mgR);
+ gr.Fill();
+ gr.SetSourceColor (mgFg);
+
+ gr.MoveTo (cb.X + (int)(gr.TextExtents (buffer.LineCount.ToString()).Width - gr.TextExtents (strLN).Width), y + fe.Ascent);
+ gr.ShowText (strLN);
+ gr.Fill ();
+ }
+
+
+
+ //draw folding
+ if (foldingEnabled){
+
+ Rectangle rFld = new Rectangle (cb.X + leftMargin - leftMarginGap - foldMargin,
+ (int)(y + (fe.Ascent + fe.Descent) / 2.0 - foldSize / 2.0), foldSize, foldSize);
+
+ gr.SetSourceColor (Color.Black);
+ gr.LineWidth = 1.0;
+
+ int level = 0;
+ bool closingNode = false;
+
+ if (currentNode != null) {
+ if (cl == currentNode.EndLine) {
+ currentNode = currentNode.Parent;
+ closingNode = true;
+ }
+ if (currentNode != null)
+ level = currentNode.Level - 1;
+ }
+
+ for (int l = 0; l < level; l++) {
+ gr.MoveTo (rFld.Center.X + 0.5, y);
+ gr.LineTo (rFld.Center.X + 0.5, y + fe.Ascent + fe.Descent);
+ rFld.Left += foldHSpace;
+ }
+ if (closingNode) {
+ gr.MoveTo (rFld.Center.X + 0.5, y);
+ gr.LineTo (rFld.Center.X + 0.5, y + fe.Ascent / 2 + 0.5);
+ gr.LineTo (rFld.Center.X + 0.5 + foldSize / 2, y + fe.Ascent / 2 + 0.5);
+ closingNode = false;
+ }
+ gr.SetDash (new double[]{ 1.5 },0.0);
+ gr.SetSourceColor (Color.Gray);
+ gr.Stroke ();
+ gr.SetDash (new double[]{}, 0.0);
+
+ if (cl.IsFoldable) {
+ gr.Rectangle (rFld);
+ gr.SetSourceColor (Color.White);
+ gr.Fill();
+ gr.SetSourceColor (Color.Black);
+ gr.Rectangle (rFld, 1.0);
+ if (cl.IsFolded) {
+ gr.MoveTo (rFld.Center.X + 0.5, rFld.Y + 2);
+ gr.LineTo (rFld.Center.X + 0.5, rFld.Bottom - 2);
+ }else
+ currentNode = cl.SyntacticNode;
+
+ gr.MoveTo (rFld.Left + 2, rFld.Center.Y + 0.5);
+ gr.LineTo (rFld.Right - 2, rFld.Center.Y + 0.5);
+ gr.Stroke ();
+ }
+ }
+
+ gr.SetSourceColor (Foreground);
+ x += leftMargin;
+
+ if (cl.Tokens == null)
+ drawRawCodeLine (gr, x, y, i, lineIndex);
+ else
+ drawParsedCodeLine (gr, x, y, i, lineIndex);
+ }
+ Node currentNode = null;
+// void drawParsed(Context gr){
+// if (PrintedLines == null)
+// return;
+//
+// gr.SelectFontFace (Font.Name, Font.Slant, Font.Wheight);
+// gr.SetFontSize (Font.Size);
+// gr.FontOptions = Interface.FontRenderingOptions;
+// gr.Antialias = Interface.Antialias;
+//
+// Rectangle cb = ClientRectangle;
+// gr.Save ();
+// CairoHelpers.CairoRectangle (gr, cb, CornerRadius);
+// gr.Clip ();
+//
+// bool selectionInProgress = false;
+//
+// Foreground.SetAsSource (gr);
+//
+// #region draw text cursor
+// if (SelBegin != SelRelease)
+// selectionInProgress = true;
+// else if (HasFocus){
+// gr.LineWidth = 1.0;
+// double cursorX = + leftMargin + cb.X + (CurrentColumn - ScrollX) * fe.MaxXAdvance;
+// gr.MoveTo (0.5 + cursorX, cb.Y + printedCurrentLine * (fe.Ascent+fe.Descent));
+// gr.LineTo (0.5 + cursorX, cb.Y + (printedCurrentLine + 1) * (fe.Ascent+fe.Descent));
+// gr.Stroke();
+// }
+// #endregion
+//
+// for (int i = 0; i < PrintedLines.Count; i++)
+// drawTokenLine (gr, i, selectionInProgress, cb);
+//
+// gr.Restore ();
+// }
+ void drawRawCodeLine(Context gr, double x, double y, int i, int lineIndex) {
+ string lstr = buffer[lineIndex].PrintableContent;
+ if (ScrollX < lstr.Length)
+ lstr = lstr.Substring (ScrollX);
+ else
+ lstr = "";
+
+ gr.MoveTo (x, y + fe.Ascent);
+ gr.ShowText (lstr);
+ gr.Fill ();
+
+ if (!buffer.SelectionIsEmpty && lineIndex >= buffer.SelectionStart.Y && lineIndex <= buffer.SelectionEnd.Y) {
+ double rLineX = x,
+ rLineY = y,
+ rLineW = lstr.Length * fe.MaxXAdvance;
+
+ //System.Diagnostics.Debug.WriteLine ("sel start: " + buffer.SelectionStart + " sel end: " + buffer.SelectionEnd);
+ if (lineIndex == buffer.SelectionStart.Y) {
+ rLineX += (selStartCol - ScrollX) * fe.MaxXAdvance;
+ rLineW -= selStartCol * fe.MaxXAdvance;
+ }
+ if (lineIndex == buffer.SelectionEnd.Y)
+ rLineW -= (lstr.Length - selEndCol) * fe.MaxXAdvance;
+
+ gr.Save ();
+ gr.Operator = Operator.Source;
+ gr.Rectangle (rLineX, rLineY, rLineW, (fe.Ascent+fe.Descent));
+ gr.SetSourceColor (SelectionBackground);
+ gr.FillPreserve ();
+ gr.Clip ();
+ gr.Operator = Operator.Over;
+ gr.SetSourceColor (SelectionForeground);
+ gr.MoveTo (x, y + fe.Ascent);
+ gr.ShowText (lstr);
+ gr.Fill ();
+ gr.Restore ();
+ }
+ }
+ void drawParsedCodeLine (Context gr, double x, double y, int i, int lineIndex) {
+ int lPtr = 0;
+ CodeLine cl = PrintedLines[i];
+
+ for (int t = 0; t < cl.Tokens.Count; t++) {
+ string lstr = cl.Tokens [t].PrintableContent;
+ if (lPtr < ScrollX) {
+ if (lPtr - ScrollX + lstr.Length <= 0) {
+ lPtr += lstr.Length;
+ continue;
+ }
+ lstr = lstr.Substring (ScrollX - lPtr);
+ lPtr += ScrollX - lPtr;
+ }
+ Color bg = this.Background;
+ Color fg = this.Foreground;
+ Color selbg = this.SelectionBackground;
+ Color selfg = this.SelectionForeground;
+ FontSlant fts = FontSlant.Normal;
+ FontWeight ftw = FontWeight.Normal;
+
+ if (formatting.ContainsKey ((int)cl.Tokens [t].Type)) {
+ TextFormatting tf = formatting [(int)cl.Tokens [t].Type];
+ bg = tf.Background;
+ fg = tf.Foreground;
+ if (tf.Bold)
+ ftw = FontWeight.Bold;
+ if (tf.Italic)
+ fts = FontSlant.Italic;
+ }
+
+ gr.SelectFontFace (Font.Name, fts, ftw);
+ gr.SetSourceColor (fg);
+
+ gr.MoveTo (x, y + fe.Ascent);
+ gr.ShowText (lstr);
+ gr.Fill ();
+
+ if (buffer.SelectionInProgress && lineIndex >= buffer.SelectionStart.Y && lineIndex <= buffer.SelectionEnd.Y &&
+ !(lineIndex == buffer.SelectionStart.Y && lPtr + lstr.Length <= selStartCol) &&
+ !(lineIndex == buffer.SelectionEnd.Y && selEndCol <= lPtr)) {
+
+ double rLineX = x,
+ rLineY = y,
+ rLineW = lstr.Length * fe.MaxXAdvance;
+ double startAdjust = 0.0;
+
+ if ((lineIndex == buffer.SelectionStart.Y) && (selStartCol < lPtr + lstr.Length) && (selStartCol > lPtr))
+ startAdjust = (selStartCol - lPtr) * fe.MaxXAdvance;
+ rLineX += startAdjust;
+ if ((lineIndex == buffer.SelectionEnd.Y) && (selEndCol < lPtr + lstr.Length))
+ rLineW = (selEndCol - lPtr) * fe.MaxXAdvance;
+ rLineW -= startAdjust;
+
+ gr.Save ();
+ gr.Operator = Operator.Source;
+ gr.Rectangle (rLineX, rLineY, rLineW, (fe.Ascent+fe.Descent));
+ gr.SetSourceColor (selbg);
+ gr.FillPreserve ();
+ gr.Clip ();
+ gr.Operator = Operator.Over;
+ gr.SetSourceColor (selfg);
+ gr.MoveTo (x, y + fe.Ascent);
+ gr.ShowText (lstr);
+ gr.Fill ();
+ gr.Restore ();
+ }
+ x += (int)lstr.Length * fe.MaxXAdvance;
+ lPtr += lstr.Length;
+ }
+ }
+
+ #endregion
+
+ #region GraphicObject overrides
+ public override Font Font {
+ get { return base.Font; }
+ set {
+ base.Font = value;
+
+ using (ImageSurface img = new ImageSurface (Format.Argb32, 1, 1)) {
+ using (Context gr = new Context (img)) {
+ gr.SelectFontFace (Font.Name, Font.Slant, Font.Wheight);
+ gr.SetFontSize (Font.Size);
+
+ fe = gr.FontExtents;
+ }
+ }
+ MaxScrollY = 0;
+ RegisterForGraphicUpdate ();
+ }
+ }
+ protected override int measureRawSize(LayoutingType lt)
+ {
+ if (lt == LayoutingType.Height)
+ return (int)Math.Ceiling((fe.Ascent+fe.Descent) * buffer.LineCount) + Margin * 2;
+
+ return (int)(fe.MaxXAdvance * buffer.longestLineCharCount) + Margin * 2 + leftMargin;
+ }
+ public override void OnLayoutChanges (LayoutingType layoutType)
+ {
+ base.OnLayoutChanges (layoutType);
+
+ if (layoutType == LayoutingType.Height)
+ updateVisibleLines ();
+ else if (layoutType == LayoutingType.Width)
+ updateVisibleColumns ();
+ }
+
+ protected override void onDraw (Context gr)
+ {
+ base.onDraw (gr);
+
+ gr.SelectFontFace (Font.Name, Font.Slant, Font.Wheight);
+ gr.SetFontSize (Font.Size);
+ gr.FontOptions = Interface.FontRenderingOptions;
+ gr.Antialias = Interface.Antialias;
+
+ Rectangle cb = ClientRectangle;
+
+ Foreground.SetAsSource (gr);
+
+ buffer.editMutex.EnterReadLock ();
+ editorMutex.EnterReadLock ();
+
+ #region draw text cursor
+ if (buffer.SelectionInProgress){
+ selStartCol = getTabulatedColumn (buffer.SelectionStart);
+ selEndCol = getTabulatedColumn (buffer.SelectionEnd);
+ }else if (HasFocus && printedCurrentLine >= 0){
+ gr.LineWidth = 1.0;
+ double cursorX = cb.X + (getTabulatedColumn(buffer.CurrentPosition) - ScrollX) * fe.MaxXAdvance + leftMargin;
+ gr.MoveTo (0.5 + cursorX, cb.Y + (printedCurrentLine) * (fe.Ascent+fe.Descent));
+ gr.LineTo (0.5 + cursorX, cb.Y + (printedCurrentLine + 1) * (fe.Ascent+fe.Descent));
+ gr.Stroke();
+ }
+ #endregion
+
+ if (PrintedLines?.Count > 0) {
+ int unfoldedLines = buffer.UnfoldedLines;
+ currentNode = null;
+ CodeLine cl = PrintedLines[0];
+ int idx0 = buffer.IndexOf(cl);
+ int li = idx0-1;
+ while (li >= 0) {
+ if (buffer [li].IsFoldable && !buffer [li].IsFolded) {
+ if (buffer.IndexOf(buffer [li].SyntacticNode.EndLine) > idx0){
+ currentNode = buffer [li].SyntacticNode;
+ break;
+ }
+ }
+ li--;
+ }
+
+ for (int i = 0; i < visibleLines; i++) {
+ if (i + ScrollY >= unfoldedLines)//TODO:need optimize
+ break;
+ drawLine (gr, cb, i);
+ }
+ }
+
+ editorMutex.ExitReadLock ();
+
+ buffer.editMutex.ExitReadLock ();
+
+ }
+ #endregion
+
+ #region Mouse handling
+
+ int hoverLine = -1;
+ public int HoverLine {
+ get { return hoverLine; }
+ set {
+ if (hoverLine == value)
+ return;
+ hoverLine = value;
+ NotifyValueChanged ("HoverLine", hoverLine);
+ }
+ }
+ void updateHoverLine () {
+ int hvl = (int)Math.Max (0, Math.Floor (mouseLocalPos.Y / (fe.Ascent+fe.Descent)));
+ hvl = Math.Min (PrintedLines.Count, hvl);
+ HoverLine = buffer.IndexOf (PrintedLines[hvl]);
+ }
+ void updateCurrentPosFromMouseLocalPos(){
+ PrintedCurrentLine = (int)Math.Max (0, Math.Floor (mouseLocalPos.Y / (fe.Ascent+fe.Descent)));
+ int curVisualCol = ScrollX + (int)Math.Round ((mouseLocalPos.X - leftMargin) / fe.MaxXAdvance);
+
+ int i = 0;
+ int buffCol = 0;
+ while (i < curVisualCol && buffCol < buffer.CurrentCodeLine.Length) {
+ if (buffer.CurrentCodeLine[buffCol] == '\t')
+ i += Interface.TabSize;
+ else
+ i++;
+ buffCol++;
+ }
+ buffer.CurrentColumn = buffCol;
+ }
+ public override void onMouseEnter (object sender, MouseMoveEventArgs e)
+ {
+ base.onMouseEnter (sender, e);
+ if (e.X - ScreenCoordinates(Slot).X < leftMargin + ClientRectangle.X)
+ IFace.MouseCursor = XCursor.Default;
+ else
+ IFace.MouseCursor = XCursor.Text;
+ }
+ public override void onMouseLeave (object sender, MouseMoveEventArgs e)
+ {
+ base.onMouseLeave (sender, e);
+ IFace.MouseCursor = XCursor.Default;
+ }
+ public override void onMouseMove (object sender, MouseMoveEventArgs e)
+ {
+ base.onMouseMove (sender, e);
+
+ mouseLocalPos = e.Position - ScreenCoordinates(Slot).TopLeft - ClientRectangle.TopLeft;
+
+ updateHoverLine ();
+
+ if (!e.Mouse.IsButtonDown (MouseButton.Left)) {
+ if (mouseLocalPos.X < leftMargin)
+ IFace.MouseCursor = XCursor.Default;
+ else
+ IFace.MouseCursor = XCursor.Text;
+ return;
+ }
+
+ if (!HasFocus || !buffer.SelectionInProgress)
+ return;
+
+ //mouse is down
+ updateCurrentPosFromMouseLocalPos();
+ buffer.SetSelEndPos ();
+ }
+ public override void onMouseDown (object sender, MouseButtonEventArgs e)
+ {
+ if (!this.Focusable)
+ return;
+
+ if (mouseLocalPos.X >= leftMargin)
+ base.onMouseDown (sender, e);
+
+ if (doubleClicked) {
+ doubleClicked = false;
+ return;
+ }
+
+ if (mouseLocalPos.X < leftMargin) {
+ toogleFolding (buffer.IndexOf (PrintedLines [(int)Math.Max (0, Math.Floor (mouseLocalPos.Y / (fe.Ascent+fe.Descent)))]));
+ return;
+ }
+
+ updateCurrentPosFromMouseLocalPos ();
+ buffer.SetSelStartPos ();
+ }
+ public override void onMouseUp (object sender, MouseButtonEventArgs e)
+ {
+ base.onMouseUp (sender, e);
+
+ if (buffer.SelectionIsEmpty)
+ buffer.ResetSelection ();
+ }
+
+ public override void onMouseDoubleClick (object sender, MouseButtonEventArgs e)
+ {
+ doubleClicked = true;
+ base.onMouseDoubleClick (sender, e);
+
+ buffer.GotoWordStart ();
+ buffer.SetSelStartPos ();
+ buffer.GotoWordEnd ();
+ buffer.SetSelEndPos ();
+ }
+
+ public override void onMouseWheel (object sender, MouseWheelEventArgs e)
+ {
+ base.onMouseWheel (sender, e);
+ }
+ #endregion
+
+ #region Keyboard handling
+ public override void onKeyDown (object sender, KeyboardKeyEventArgs e)
+ {
+ //base.onKeyDown (sender, e);
+
+ Key key = e.Key;
+
+ if (e.Control) {
+ switch (key) {
+ case Key.S:
+ projFile.Save ();
+ break;
+ case Key.W:
+ editorMutex.EnterWriteLock ();
+ if (e.Shift)
+ projFile.Redo (null);
+ else
+ projFile.Undo (null);
+ editorMutex.ExitWriteLock ();
+ break;
+ default:
+ Console.WriteLine ("");
+ break;
+ }
+ }
+
+ switch (key)
+ {
+ case Key.Back:
+ buffer.DeleteChar ();
+ break;
+ case Key.Clear:
+ break;
+ case Key.Delete:
+ if (buffer.SelectionIsEmpty)
+ MoveRight ();
+ else if (e.Shift)
+ IFace.Clipboard = buffer.SelectedText;
+ buffer.DeleteChar ();
+ break;
+ case Key.Enter:
+ case Key.KeypadEnter:
+ if (!buffer.SelectionIsEmpty)
+ buffer.DeleteChar ();
+ buffer.InsertLineBreak ();
+ break;
+ case Key.Escape:
+ buffer.ResetSelection ();
+ break;
+ case Key.Home:
+ if (e.Shift) {
+ if (buffer.SelectionIsEmpty)
+ buffer.SetSelStartPos ();
+ if (e.Control)
+ buffer.CurrentLine = 0;
+ buffer.CurrentColumn = 0;
+ buffer.SetSelEndPos ();
+ break;
+ }
+ buffer.ResetSelection ();
+ if (e.Control)
+ buffer.CurrentLine = 0;
+ buffer.CurrentColumn = 0;
+ break;
+ case Key.End:
+ if (e.Shift) {
+ if (buffer.SelectionIsEmpty)
+ buffer.SetSelStartPos ();
+ if (e.Control)
+ buffer.CurrentLine = int.MaxValue;
+ buffer.CurrentColumn = int.MaxValue;
+ buffer.SetSelEndPos ();
+ break;
+ }
+ buffer.ResetSelection ();
+ if (e.Control)
+ buffer.CurrentLine = int.MaxValue;
+ buffer.CurrentColumn = int.MaxValue;
+ break;
+ case Key.Insert:
+ if (e.Shift)
+ buffer.Insert (IFace.Clipboard);
+ else if (e.Control && !buffer.SelectionIsEmpty)
+ IFace.Clipboard = buffer.SelectedText;
+ break;
+ case Key.Left:
+ if (e.Shift) {
+ if (buffer.SelectionIsEmpty)
+ buffer.SetSelStartPos ();
+ if (e.Control)
+ buffer.GotoWordStart ();
+ else
+ MoveLeft ();
+ buffer.SetSelEndPos ();
+ break;
+ }
+ buffer.ResetSelection ();
+ if (e.Control)
+ buffer.GotoWordStart ();
+ else
+ MoveLeft();
+ break;
+ case Key.Right:
+ if (e.Shift) {
+ if (buffer.SelectionIsEmpty)
+ buffer.SetSelStartPos ();
+ if (e.Control)
+ buffer.GotoWordEnd ();
+ else
+ MoveRight ();
+ buffer.SetSelEndPos ();
+ break;
+ }
+ buffer.ResetSelection ();
+ if (e.Control)
+ buffer.GotoWordEnd ();
+ else
+ MoveRight ();
+ break;
+ case Key.Up:
+ if (e.Shift) {
+ if (buffer.SelectionIsEmpty)
+ buffer.SetSelStartPos ();
+ PrintedCurrentLine--;
+ buffer.SetSelEndPos ();
+ break;
+ }
+ buffer.ResetSelection ();
+ PrintedCurrentLine--;
+ break;
+ case Key.Down:
+ if (e.Shift) {
+ if (buffer.SelectionIsEmpty)
+ buffer.SetSelStartPos ();
+ PrintedCurrentLine++;
+ buffer.SetSelEndPos ();
+ break;
+ }
+ buffer.ResetSelection ();
+ PrintedCurrentLine++;
+ break;
+ case Key.Menu:
+ break;
+ case Key.NumLock:
+ break;
+ case Key.PageDown:
+ if (e.Shift) {
+ if (buffer.SelectionIsEmpty)
+ buffer.SetSelStartPos ();
+ PrintedCurrentLine += visibleLines;
+ buffer.SetSelEndPos ();
+ break;
+ }
+ buffer.ResetSelection ();
+ PrintedCurrentLine += visibleLines;
+ break;
+ case Key.PageUp:
+ if (e.Shift) {
+ if (buffer.SelectionIsEmpty)
+ buffer.SetSelStartPos ();
+ PrintedCurrentLine -= visibleLines;
+ buffer.SetSelEndPos ();
+ break;
+ }
+ buffer.ResetSelection ();
+ PrintedCurrentLine -= visibleLines;
+ break;
+ case Key.RWin:
+ break;
+ case Key.Tab:
+ if (e.Shift) {
+ if (buffer.SelectionIsEmpty ||
+ (buffer.SelectionStart.Y == buffer.SelectionEnd.Y)) {
+ //TODO
+ break;
+ }
+ for (int i = buffer.SelectionStart.Y; i <= buffer.SelectionEnd.Y; i++)
+ buffer.RemoveLeadingTab (i);
+ buffer.SetSelectionOnFullLines ();
+ } else {
+ if (buffer.SelectionIsEmpty ||
+ (buffer.SelectionStart.Y == buffer.SelectionEnd.Y)) {
+ buffer.Insert ("\t");
+ break;
+ }
+ for (int i = buffer.SelectionStart.Y; i <= buffer.SelectionEnd.Y; i++) {
+ buffer.UpdateLine (i, "\t" + buffer [i].Content);
+ }
+ }
+
+ break;
+ case Key.F8:
+ toogleFolding (buffer.CurrentLine);
+ break;
+ default:
+ break;
+ }
+ RegisterForGraphicUpdate();
+ }
+ public override void onKeyPress (object sender, KeyPressEventArgs e)
+ {
+ base.onKeyPress (sender, e);
+
+ buffer.Insert (e.KeyChar.ToString());
+ buffer.ResetSelection ();
+ }
+ #endregion
+ }
+}
\ No newline at end of file
R = _R.Clamp(0,1);
G = _G.Clamp(0,1);
B = _B.Clamp(0,1);
+ predefinied = false;
+ htmlCode = "";
Name = "";
}
internal Color(double _R, double _G, double _B, double _A, string _name)
R = _R;
G = _G;
B = _B;
+ predefinied = false;
Name = _name;
+ htmlCode = "";
+ ColorDic.Add(_name,this);
+ }
+ internal Color(int _R, int _G, int _B, string _name, string _code)
+ {
+ A = 1.0;
+ R = _R / 255.0;
+ G = _G / 255.0;
+ B = _B / 255.0;
+ Name = _name;
+ htmlCode = _code;
+ predefinied = true;
ColorDic.Add(_name,this);
}
#endregion
/// </summary>
public static Dictionary<string, Color> ColorDic = new Dictionary<string, Color>();
- internal string Name;
+ public string Name;
+ public string htmlCode;
+ internal bool predefinied;
#region public fields
public double A;
{
if (string.IsNullOrEmpty(s))
return White;
+ Color cc = default(Color);
+ if (s.StartsWith ("#")) {
+ cc.R = int.Parse (s.Substring (1, 2), System.Globalization.NumberStyles.HexNumber) / 255.0;
+ cc.G = int.Parse (s.Substring (3, 2), System.Globalization.NumberStyles.HexNumber) / 255.0;
+ cc.B = int.Parse (s.Substring (5, 2), System.Globalization.NumberStyles.HexNumber) / 255.0;
+ if (s.Length > 7)
+ cc.A = int.Parse (s.Substring (7, 2), System.Globalization.NumberStyles.HexNumber) / 255.0;
+ return cc;
+ }
- string[] c = s.Split(new char[] { ',' });
-
- if (c.Length == 1)
- {
+ if (char.IsLetter(s[0])){
if (ColorDic.ContainsKey (s))
return ColorDic[s];
throw new Exception ("Unknown color name: " + s);
}
+
+ string[] c = s.Split(new char[] { ',' });
+
return new Color(
double.Parse(c[0]),
double.Parse(c[1]),
public static bool operator ==(Color left, Color right)
{
+ if (left.predefinied & right.predefinied)
+ return left.htmlCode == right.htmlCode;
return left.A != right.A ? false :
left.R != right.R ? false :
left.G != right.G ? false :
}
public static bool operator !=(Color left, Color right)
{
+ if (left.predefinied & right.predefinied)
+ return left.htmlCode != right.htmlCode;
return left.A == right.A ? false :
left.R == right.R ? false :
left.G == right.G ? false :
}
public static bool operator ==(Color c, string n)
{
- return string.Equals(c.Name, n, StringComparison.Ordinal);
+ return n.StartsWith("#") ?
+ string.Equals(c.HtmlCode, n, StringComparison.Ordinal) :
+ string.Equals(c.Name, n, StringComparison.Ordinal);
}
public static bool operator !=(Color c, string n)
{
- return !string.Equals(c.Name, n, StringComparison.Ordinal);
+ return n.StartsWith("#") ?
+ !string.Equals(c.HtmlCode, n, StringComparison.Ordinal) :
+ !string.Equals(c.Name, n, StringComparison.Ordinal);
}
public static bool operator ==(string n, Color c)
{
return diff == 0 ? 0 : diff / max;
}
}
-
+ public string HtmlCode {
+ get {
+ string tmp = "#" +
+ ((int)Math.Round (R * 255.0)).ToString ("X2") +
+ ((int)Math.Round (G * 255.0)).ToString ("X2") +
+ ((int)Math.Round (B * 255.0)).ToString ("X2");
+ if (A < 1.0)
+ tmp += ((int)Math.Round(A * 255.0)).ToString ("X2");
+ return tmp;
+ }
+ }
public float[] floatArray
{
get { return new float[]{ (float)R, (float)G, (float)B, (float)A }; }
}
public void ResetName(){
Name = "";
+ htmlCode = "";
}
#region Predefined colors
public static readonly Color Transparent = new Color(0, 0, 0, 0, "Transparent");
public static readonly Color Clear = new Color(-1, -1, -1, -1, "Clear");
- public static readonly Color Green = new Color(0, 1.0, 0, 1.0, "Green");
- public static readonly Color AirForceBlueRaf = new Color(0.364705882352941,0.541176470588235,0.658823529411765,1.0,"AirForceBlueRaf");
- public static readonly Color AirForceBlueUsaf = new Color(0,0.188235294117647,0.56078431372549,1.0,"AirForceBlueUsaf");
- public static readonly Color AirSuperiorityBlue = new Color(0.447058823529412,0.627450980392157,0.756862745098039,1.0,"AirSuperiorityBlue");
- public static readonly Color AlabamaCrimson = new Color(0.63921568627451,0.149019607843137,0.219607843137255,1.0,"AlabamaCrimson");
- public static readonly Color AliceBlue = new Color(0.941176470588235,0.972549019607843,1,1.0,"AliceBlue");
- public static readonly Color AlizarinCrimson = new Color(0.890196078431373,0.149019607843137,0.211764705882353,1.0,"AlizarinCrimson");
- public static readonly Color AlloyOrange = new Color(0.768627450980392,0.384313725490196,0.0627450980392157,1.0,"AlloyOrange");
- public static readonly Color Almond = new Color(0.937254901960784,0.870588235294118,0.803921568627451,1.0,"Almond");
- public static readonly Color Amaranth = new Color(0.898039215686275,0.168627450980392,0.313725490196078,1.0,"Amaranth");
- public static readonly Color Amber = new Color(1,0.749019607843137,0,1.0,"Amber");
- public static readonly Color AmberSaeEce = new Color(1,0.494117647058824,0,1.0,"AmberSaeEce");
- public static readonly Color AmericanRose = new Color(1,0.0117647058823529,0.243137254901961,1.0,"AmericanRose");
- public static readonly Color Amethyst = new Color(0.6,0.4,0.8,1.0,"Amethyst");
- public static readonly Color AndroidGreen = new Color(0.643137254901961,0.776470588235294,0.223529411764706,1.0,"AndroidGreen");
- public static readonly Color AntiFlashWhite = new Color(0.949019607843137,0.952941176470588,0.956862745098039,1.0,"AntiFlashWhite");
- public static readonly Color AntiqueBrass = new Color(0.803921568627451,0.584313725490196,0.458823529411765,1.0,"AntiqueBrass");
- public static readonly Color AntiqueFuchsia = new Color(0.568627450980392,0.36078431372549,0.513725490196078,1.0,"AntiqueFuchsia");
- public static readonly Color AntiqueRuby = new Color(0.517647058823529,0.105882352941176,0.176470588235294,1.0,"AntiqueRuby");
- public static readonly Color AntiqueWhite = new Color(0.980392156862745,0.92156862745098,0.843137254901961,1.0,"AntiqueWhite");
- public static readonly Color AoEnglish = new Color(0,0.501960784313725,0,1.0,"AoEnglish");
- public static readonly Color AppleGreen = new Color(0.552941176470588,0.713725490196078,0,1.0,"AppleGreen");
- public static readonly Color Apricot = new Color(0.984313725490196,0.807843137254902,0.694117647058824,1.0,"Apricot");
- public static readonly Color Aqua = new Color(0,1,1,1.0,"Aqua");
- public static readonly Color Aquamarine = new Color(0.498039215686275,1,0.831372549019608,1.0,"Aquamarine");
- public static readonly Color ArmyGreen = new Color(0.294117647058824,0.325490196078431,0.125490196078431,1.0,"ArmyGreen");
- public static readonly Color Arsenic = new Color(0.231372549019608,0.266666666666667,0.294117647058824,1.0,"Arsenic");
- public static readonly Color ArylideYellow = new Color(0.913725490196078,0.83921568627451,0.419607843137255,1.0,"ArylideYellow");
- public static readonly Color AshGrey = new Color(0.698039215686274,0.745098039215686,0.709803921568627,1.0,"AshGrey");
- public static readonly Color Asparagus = new Color(0.529411764705882,0.662745098039216,0.419607843137255,1.0,"Asparagus");
- public static readonly Color AtomicTangerine = new Color(1,0.6,0.4,1.0,"AtomicTangerine");
- public static readonly Color Auburn = new Color(0.647058823529412,0.164705882352941,0.164705882352941,1.0,"Auburn");
- public static readonly Color Aureolin = new Color(0.992156862745098,0.933333333333333,0,1.0,"Aureolin");
- public static readonly Color Aurometalsaurus = new Color(0.431372549019608,0.498039215686275,0.501960784313725,1.0,"Aurometalsaurus");
- public static readonly Color Avocado = new Color(0.337254901960784,0.509803921568627,0.0117647058823529,1.0,"Avocado");
- public static readonly Color Azure = new Color(0,0.498039215686275,1,1.0,"Azure");
- public static readonly Color AzureMistWeb = new Color(0.941176470588235,1,1,1.0,"AzureMistWeb");
- public static readonly Color BabyBlue = new Color(0.537254901960784,0.811764705882353,0.941176470588235,1.0,"BabyBlue");
- public static readonly Color BabyBlueEyes = new Color(0.631372549019608,0.792156862745098,0.945098039215686,1.0,"BabyBlueEyes");
- public static readonly Color BabyPink = new Color(0.956862745098039,0.76078431372549,0.76078431372549,1.0,"BabyPink");
- public static readonly Color BallBlue = new Color(0.129411764705882,0.670588235294118,0.803921568627451,1.0,"BallBlue");
- public static readonly Color BananaMania = new Color(0.980392156862745,0.905882352941176,0.709803921568627,1.0,"BananaMania");
- public static readonly Color BananaYellow = new Color(1,0.882352941176471,0.207843137254902,1.0,"BananaYellow");
- public static readonly Color BarnRed = new Color(0.486274509803922,0.0392156862745098,0.00784313725490196,1.0,"BarnRed");
- public static readonly Color BattleshipGrey = new Color(0.517647058823529,0.517647058823529,0.509803921568627,1.0,"BattleshipGrey");
- public static readonly Color Bazaar = new Color(0.596078431372549,0.466666666666667,0.482352941176471,1.0,"Bazaar");
- public static readonly Color BeauBlue = new Color(0.737254901960784,0.831372549019608,0.901960784313726,1.0,"BeauBlue");
- public static readonly Color Beaver = new Color(0.623529411764706,0.505882352941176,0.43921568627451,1.0,"Beaver");
- public static readonly Color Beige = new Color(0.96078431372549,0.96078431372549,0.862745098039216,1.0,"Beige");
- public static readonly Color BigDipORuby = new Color(0.611764705882353,0.145098039215686,0.258823529411765,1.0,"BigDipORuby");
- public static readonly Color Bisque = new Color(1,0.894117647058824,0.768627450980392,1.0,"Bisque");
- public static readonly Color Bistre = new Color(0.23921568627451,0.168627450980392,0.12156862745098,1.0,"Bistre");
- public static readonly Color Bittersweet = new Color(0.996078431372549,0.435294117647059,0.368627450980392,1.0,"Bittersweet");
- public static readonly Color BittersweetShimmer = new Color(0.749019607843137,0.309803921568627,0.317647058823529,1.0,"BittersweetShimmer");
- public static readonly Color Black = new Color(0,0,0,1.0,"Black");
- public static readonly Color BlackBean = new Color(0.23921568627451,0.0470588235294118,0.00784313725490196,1.0,"BlackBean");
- public static readonly Color BlackLeatherJacket = new Color(0.145098039215686,0.207843137254902,0.16078431372549,1.0,"BlackLeatherJacket");
- public static readonly Color BlackOlive = new Color(0.231372549019608,0.235294117647059,0.211764705882353,1.0,"BlackOlive");
- public static readonly Color BlanchedAlmond = new Color(1,0.92156862745098,0.803921568627451,1.0,"BlanchedAlmond");
- public static readonly Color BlastOffBronze = new Color(0.647058823529412,0.443137254901961,0.392156862745098,1.0,"BlastOffBronze");
- public static readonly Color BleuDeFrance = new Color(0.192156862745098,0.549019607843137,0.905882352941176,1.0,"BleuDeFrance");
- public static readonly Color BlizzardBlue = new Color(0.674509803921569,0.898039215686275,0.933333333333333,1.0,"BlizzardBlue");
- public static readonly Color Blond = new Color(0.980392156862745,0.941176470588235,0.745098039215686,1.0,"Blond");
- public static readonly Color Blue = new Color(0,0,1,1.0,"Blue");
- public static readonly Color BlueBell = new Color(0.635294117647059,0.635294117647059,0.815686274509804,1.0,"BlueBell");
- public static readonly Color BlueCrayola = new Color(0.12156862745098,0.458823529411765,0.996078431372549,1.0,"BlueCrayola");
- public static readonly Color BlueGray = new Color(0.4,0.6,0.8,1.0,"BlueGray");
- public static readonly Color BlueGreen = new Color(0.0509803921568627,0.596078431372549,0.729411764705882,1.0,"BlueGreen");
- public static readonly Color BlueMunsell = new Color(0,0.576470588235294,0.686274509803922,1.0,"BlueMunsell");
- public static readonly Color BlueNcs = new Color(0,0.529411764705882,0.741176470588235,1.0,"BlueNcs");
- public static readonly Color BluePigment = new Color(0.2,0.2,0.6,1.0,"BluePigment");
- public static readonly Color BlueRyb = new Color(0.00784313725490196,0.27843137254902,0.996078431372549,1.0,"BlueRyb");
- public static readonly Color BlueSapphire = new Color(0.0705882352941176,0.380392156862745,0.501960784313725,1.0,"BlueSapphire");
- public static readonly Color BlueViolet = new Color(0.541176470588235,0.168627450980392,0.886274509803922,1.0,"BlueViolet");
- public static readonly Color Blush = new Color(0.870588235294118,0.364705882352941,0.513725490196078,1.0,"Blush");
- public static readonly Color Bole = new Color(0.474509803921569,0.266666666666667,0.231372549019608,1.0,"Bole");
- public static readonly Color BondiBlue = new Color(0,0.584313725490196,0.713725490196078,1.0,"BondiBlue");
- public static readonly Color Bone = new Color(0.890196078431373,0.854901960784314,0.788235294117647,1.0,"Bone");
- public static readonly Color BostonUniversityRed = new Color(0.8,0,0,1.0,"BostonUniversityRed");
- public static readonly Color BottleGreen = new Color(0,0.415686274509804,0.305882352941176,1.0,"BottleGreen");
- public static readonly Color Boysenberry = new Color(0.529411764705882,0.196078431372549,0.376470588235294,1.0,"Boysenberry");
- public static readonly Color BrandeisBlue = new Color(0,0.43921568627451,1,1.0,"BrandeisBlue");
- public static readonly Color Brass = new Color(0.709803921568627,0.650980392156863,0.258823529411765,1.0,"Brass");
- public static readonly Color BrickRed = new Color(0.796078431372549,0.254901960784314,0.329411764705882,1.0,"BrickRed");
- public static readonly Color BrightCerulean = new Color(0.113725490196078,0.674509803921569,0.83921568627451,1.0,"BrightCerulean");
- public static readonly Color BrightGreen = new Color(0.4,1,0,1.0,"BrightGreen");
- public static readonly Color BrightLavender = new Color(0.749019607843137,0.580392156862745,0.894117647058824,1.0,"BrightLavender");
- public static readonly Color BrightMaroon = new Color(0.764705882352941,0.129411764705882,0.282352941176471,1.0,"BrightMaroon");
- public static readonly Color BrightPink = new Color(1,0,0.498039215686275,1.0,"BrightPink");
- public static readonly Color BrightTurquoise = new Color(0.0313725490196078,0.909803921568627,0.870588235294118,1.0,"BrightTurquoise");
- public static readonly Color BrightUbe = new Color(0.819607843137255,0.623529411764706,0.909803921568627,1.0,"BrightUbe");
- public static readonly Color BrilliantLavender = new Color(0.956862745098039,0.733333333333333,1,1.0,"BrilliantLavender");
- public static readonly Color BrilliantRose = new Color(1,0.333333333333333,0.63921568627451,1.0,"BrilliantRose");
- public static readonly Color BrinkPink = new Color(0.984313725490196,0.376470588235294,0.498039215686275,1.0,"BrinkPink");
- public static readonly Color BritishRacingGreen = new Color(0,0.258823529411765,0.145098039215686,1.0,"BritishRacingGreen");
- public static readonly Color Bronze = new Color(0.803921568627451,0.498039215686275,0.196078431372549,1.0,"Bronze");
- public static readonly Color BrownTraditional = new Color(0.588235294117647,0.294117647058824,0,1.0,"BrownTraditional");
- public static readonly Color BrownWeb = new Color(0.647058823529412,0.164705882352941,0.164705882352941,1.0,"BrownWeb");
- public static readonly Color BubbleGum = new Color(1,0.756862745098039,0.8,1.0,"BubbleGum");
- public static readonly Color Bubbles = new Color(0.905882352941176,0.996078431372549,1,1.0,"Bubbles");
- public static readonly Color Buff = new Color(0.941176470588235,0.862745098039216,0.509803921568627,1.0,"Buff");
- public static readonly Color BulgarianRose = new Color(0.282352941176471,0.0235294117647059,0.0274509803921569,1.0,"BulgarianRose");
- public static readonly Color Burgundy = new Color(0.501960784313725,0,0.125490196078431,1.0,"Burgundy");
- public static readonly Color Burlywood = new Color(0.870588235294118,0.72156862745098,0.529411764705882,1.0,"Burlywood");
- public static readonly Color BurntOrange = new Color(0.8,0.333333333333333,0,1.0,"BurntOrange");
- public static readonly Color BurntSienna = new Color(0.913725490196078,0.454901960784314,0.317647058823529,1.0,"BurntSienna");
- public static readonly Color BurntUmber = new Color(0.541176470588235,0.2,0.141176470588235,1.0,"BurntUmber");
- public static readonly Color Byzantine = new Color(0.741176470588235,0.2,0.643137254901961,1.0,"Byzantine");
- public static readonly Color Byzantium = new Color(0.43921568627451,0.16078431372549,0.388235294117647,1.0,"Byzantium");
- public static readonly Color Cadet = new Color(0.325490196078431,0.407843137254902,0.447058823529412,1.0,"Cadet");
- public static readonly Color CadetBlue = new Color(0.372549019607843,0.619607843137255,0.627450980392157,1.0,"CadetBlue");
- public static readonly Color CadetGrey = new Color(0.568627450980392,0.63921568627451,0.690196078431373,1.0,"CadetGrey");
- public static readonly Color CadmiumGreen = new Color(0,0.419607843137255,0.235294117647059,1.0,"CadmiumGreen");
- public static readonly Color CadmiumOrange = new Color(0.929411764705882,0.529411764705882,0.176470588235294,1.0,"CadmiumOrange");
- public static readonly Color CadmiumRed = new Color(0.890196078431373,0,0.133333333333333,1.0,"CadmiumRed");
- public static readonly Color CadmiumYellow = new Color(1,0.964705882352941,0,1.0,"CadmiumYellow");
- public static readonly Color CafAuLait = new Color(0.650980392156863,0.482352941176471,0.356862745098039,1.0,"CafAuLait");
- public static readonly Color CafNoir = new Color(0.294117647058824,0.211764705882353,0.129411764705882,1.0,"CafNoir");
- public static readonly Color CalPolyGreen = new Color(0.117647058823529,0.301960784313725,0.168627450980392,1.0,"CalPolyGreen");
- public static readonly Color CambridgeBlue = new Color(0.63921568627451,0.756862745098039,0.67843137254902,1.0,"CambridgeBlue");
- public static readonly Color Camel = new Color(0.756862745098039,0.603921568627451,0.419607843137255,1.0,"Camel");
- public static readonly Color CameoPink = new Color(0.937254901960784,0.733333333333333,0.8,1.0,"CameoPink");
- public static readonly Color CamouflageGreen = new Color(0.470588235294118,0.525490196078431,0.419607843137255,1.0,"CamouflageGreen");
- public static readonly Color CanaryYellow = new Color(1,0.937254901960784,0,1.0,"CanaryYellow");
- public static readonly Color CandyAppleRed = new Color(1,0.0313725490196078,0,1.0,"CandyAppleRed");
- public static readonly Color CandyPink = new Color(0.894117647058824,0.443137254901961,0.47843137254902,1.0,"CandyPink");
- public static readonly Color Capri = new Color(0,0.749019607843137,1,1.0,"Capri");
- public static readonly Color CaputMortuum = new Color(0.349019607843137,0.152941176470588,0.125490196078431,1.0,"CaputMortuum");
- public static readonly Color Cardinal = new Color(0.768627450980392,0.117647058823529,0.227450980392157,1.0,"Cardinal");
- public static readonly Color CaribbeanGreen = new Color(0,0.8,0.6,1.0,"CaribbeanGreen");
- public static readonly Color Carmine = new Color(0.588235294117647,0,0.0941176470588235,1.0,"Carmine");
- public static readonly Color CarmineMP = new Color(0.843137254901961,0,0.250980392156863,1.0,"CarmineMP");
- public static readonly Color CarminePink = new Color(0.92156862745098,0.298039215686275,0.258823529411765,1.0,"CarminePink");
- public static readonly Color CarmineRed = new Color(1,0,0.219607843137255,1.0,"CarmineRed");
- public static readonly Color CarnationPink = new Color(1,0.650980392156863,0.788235294117647,1.0,"CarnationPink");
- public static readonly Color Carnelian = new Color(0.701960784313725,0.105882352941176,0.105882352941176,1.0,"Carnelian");
- public static readonly Color CarolinaBlue = new Color(0.6,0.729411764705882,0.866666666666667,1.0,"CarolinaBlue");
- public static readonly Color CarrotOrange = new Color(0.929411764705882,0.568627450980392,0.129411764705882,1.0,"CarrotOrange");
- public static readonly Color CatalinaBlue = new Color(0.0235294117647059,0.164705882352941,0.470588235294118,1.0,"CatalinaBlue");
- public static readonly Color Ceil = new Color(0.572549019607843,0.631372549019608,0.811764705882353,1.0,"Ceil");
- public static readonly Color Celadon = new Color(0.674509803921569,0.882352941176471,0.686274509803922,1.0,"Celadon");
- public static readonly Color CeladonBlue = new Color(0,0.482352941176471,0.654901960784314,1.0,"CeladonBlue");
- public static readonly Color CeladonGreen = new Color(0.184313725490196,0.517647058823529,0.486274509803922,1.0,"CeladonGreen");
- public static readonly Color CelesteColour = new Color(0.698039215686274,1,1,1.0,"CelesteColour");
- public static readonly Color CelestialBlue = new Color(0.286274509803922,0.592156862745098,0.815686274509804,1.0,"CelestialBlue");
- public static readonly Color Cerise = new Color(0.870588235294118,0.192156862745098,0.388235294117647,1.0,"Cerise");
- public static readonly Color CerisePink = new Color(0.925490196078431,0.231372549019608,0.513725490196078,1.0,"CerisePink");
- public static readonly Color Cerulean = new Color(0,0.482352941176471,0.654901960784314,1.0,"Cerulean");
- public static readonly Color CeruleanBlue = new Color(0.164705882352941,0.32156862745098,0.745098039215686,1.0,"CeruleanBlue");
- public static readonly Color CeruleanFrost = new Color(0.427450980392157,0.607843137254902,0.764705882352941,1.0,"CeruleanFrost");
- public static readonly Color CgBlue = new Color(0,0.47843137254902,0.647058823529412,1.0,"CgBlue");
- public static readonly Color CgRed = new Color(0.87843137254902,0.235294117647059,0.192156862745098,1.0,"CgRed");
- public static readonly Color Chamoisee = new Color(0.627450980392157,0.470588235294118,0.352941176470588,1.0,"Chamoisee");
- public static readonly Color Champagne = new Color(0.980392156862745,0.83921568627451,0.647058823529412,1.0,"Champagne");
- public static readonly Color Charcoal = new Color(0.211764705882353,0.270588235294118,0.309803921568627,1.0,"Charcoal");
- public static readonly Color CharmPink = new Color(0.901960784313726,0.56078431372549,0.674509803921569,1.0,"CharmPink");
- public static readonly Color ChartreuseTraditional = new Color(0.874509803921569,1,0,1.0,"ChartreuseTraditional");
- public static readonly Color ChartreuseWeb = new Color(0.498039215686275,1,0,1.0,"ChartreuseWeb");
- public static readonly Color Cherry = new Color(0.870588235294118,0.192156862745098,0.388235294117647,1.0,"Cherry");
- public static readonly Color CherryBlossomPink = new Color(1,0.717647058823529,0.772549019607843,1.0,"CherryBlossomPink");
- public static readonly Color Chestnut = new Color(0.803921568627451,0.36078431372549,0.36078431372549,1.0,"Chestnut");
- public static readonly Color ChinaPink = new Color(0.870588235294118,0.435294117647059,0.631372549019608,1.0,"ChinaPink");
- public static readonly Color ChinaRose = new Color(0.658823529411765,0.317647058823529,0.431372549019608,1.0,"ChinaRose");
- public static readonly Color ChineseRed = new Color(0.666666666666667,0.219607843137255,0.117647058823529,1.0,"ChineseRed");
- public static readonly Color ChocolateTraditional = new Color(0.482352941176471,0.247058823529412,0,1.0,"ChocolateTraditional");
- public static readonly Color ChocolateWeb = new Color(0.823529411764706,0.411764705882353,0.117647058823529,1.0,"ChocolateWeb");
- public static readonly Color ChromeYellow = new Color(1,0.654901960784314,0,1.0,"ChromeYellow");
- public static readonly Color Cinereous = new Color(0.596078431372549,0.505882352941176,0.482352941176471,1.0,"Cinereous");
- public static readonly Color Cinnabar = new Color(0.890196078431373,0.258823529411765,0.203921568627451,1.0,"Cinnabar");
- public static readonly Color Cinnamon = new Color(0.823529411764706,0.411764705882353,0.117647058823529,1.0,"Cinnamon");
- public static readonly Color Citrine = new Color(0.894117647058824,0.815686274509804,0.0392156862745098,1.0,"Citrine");
- public static readonly Color ClassicRose = new Color(0.984313725490196,0.8,0.905882352941176,1.0,"ClassicRose");
- public static readonly Color Cobalt = new Color(0,0.27843137254902,0.670588235294118,1.0,"Cobalt");
- public static readonly Color CocoaBrown = new Color(0.823529411764706,0.411764705882353,0.117647058823529,1.0,"CocoaBrown");
- public static readonly Color Coffee = new Color(0.435294117647059,0.305882352941176,0.215686274509804,1.0,"Coffee");
- public static readonly Color ColumbiaBlue = new Color(0.607843137254902,0.866666666666667,1,1.0,"ColumbiaBlue");
- public static readonly Color CongoPink = new Color(0.972549019607843,0.513725490196078,0.474509803921569,1.0,"CongoPink");
- public static readonly Color CoolBlack = new Color(0,0.180392156862745,0.388235294117647,1.0,"CoolBlack");
- public static readonly Color CoolGrey = new Color(0.549019607843137,0.572549019607843,0.674509803921569,1.0,"CoolGrey");
- public static readonly Color Copper = new Color(0.72156862745098,0.450980392156863,0.2,1.0,"Copper");
- public static readonly Color CopperCrayola = new Color(0.854901960784314,0.541176470588235,0.403921568627451,1.0,"CopperCrayola");
- public static readonly Color CopperPenny = new Color(0.67843137254902,0.435294117647059,0.411764705882353,1.0,"CopperPenny");
- public static readonly Color CopperRed = new Color(0.796078431372549,0.427450980392157,0.317647058823529,1.0,"CopperRed");
- public static readonly Color CopperRose = new Color(0.6,0.4,0.4,1.0,"CopperRose");
- public static readonly Color Coquelicot = new Color(1,0.219607843137255,0,1.0,"Coquelicot");
- public static readonly Color Coral = new Color(1,0.498039215686275,0.313725490196078,1.0,"Coral");
- public static readonly Color CoralPink = new Color(0.972549019607843,0.513725490196078,0.474509803921569,1.0,"CoralPink");
- public static readonly Color CoralRed = new Color(1,0.250980392156863,0.250980392156863,1.0,"CoralRed");
- public static readonly Color Cordovan = new Color(0.537254901960784,0.247058823529412,0.270588235294118,1.0,"Cordovan");
- public static readonly Color Corn = new Color(0.984313725490196,0.925490196078431,0.364705882352941,1.0,"Corn");
- public static readonly Color CornellRed = new Color(0.701960784313725,0.105882352941176,0.105882352941176,1.0,"CornellRed");
- public static readonly Color CornflowerBlue = new Color(0.392156862745098,0.584313725490196,0.929411764705882,1.0,"CornflowerBlue");
- public static readonly Color Cornsilk = new Color(1,0.972549019607843,0.862745098039216,1.0,"Cornsilk");
- public static readonly Color CosmicLatte = new Color(1,0.972549019607843,0.905882352941176,1.0,"CosmicLatte");
- public static readonly Color CottonCandy = new Color(1,0.737254901960784,0.850980392156863,1.0,"CottonCandy");
- public static readonly Color Cream = new Color(1,0.992156862745098,0.815686274509804,1.0,"Cream");
- public static readonly Color Crimson = new Color(0.862745098039216,0.0784313725490196,0.235294117647059,1.0,"Crimson");
- public static readonly Color CrimsonGlory = new Color(0.745098039215686,0,0.196078431372549,1.0,"CrimsonGlory");
- public static readonly Color Cyan = new Color(0,1,1,1.0,"Cyan");
- public static readonly Color CyanProcess = new Color(0,0.717647058823529,0.92156862745098,1.0,"CyanProcess");
- public static readonly Color Daffodil = new Color(1,1,0.192156862745098,1.0,"Daffodil");
- public static readonly Color Dandelion = new Color(0.941176470588235,0.882352941176471,0.188235294117647,1.0,"Dandelion");
- public static readonly Color DarkBlue = new Color(0,0,0.545098039215686,1.0,"DarkBlue");
- public static readonly Color DarkBrown = new Color(0.396078431372549,0.262745098039216,0.129411764705882,1.0,"DarkBrown");
- public static readonly Color DarkByzantium = new Color(0.364705882352941,0.223529411764706,0.329411764705882,1.0,"DarkByzantium");
- public static readonly Color DarkCandyAppleRed = new Color(0.643137254901961,0,0,1.0,"DarkCandyAppleRed");
- public static readonly Color DarkCerulean = new Color(0.0313725490196078,0.270588235294118,0.494117647058824,1.0,"DarkCerulean");
- public static readonly Color DarkChestnut = new Color(0.596078431372549,0.411764705882353,0.376470588235294,1.0,"DarkChestnut");
- public static readonly Color DarkCoral = new Color(0.803921568627451,0.356862745098039,0.270588235294118,1.0,"DarkCoral");
- public static readonly Color DarkCyan = new Color(0,0.545098039215686,0.545098039215686,1.0,"DarkCyan");
- public static readonly Color DarkElectricBlue = new Color(0.325490196078431,0.407843137254902,0.470588235294118,1.0,"DarkElectricBlue");
- public static readonly Color DarkGoldenrod = new Color(0.72156862745098,0.525490196078431,0.0431372549019608,1.0,"DarkGoldenrod");
- public static readonly Color DarkGray = new Color(0.662745098039216,0.662745098039216,0.662745098039216,1.0,"DarkGray");
- public static readonly Color DarkGreen = new Color(0.00392156862745098,0.196078431372549,0.125490196078431,1.0,"DarkGreen");
- public static readonly Color DarkImperialBlue = new Color(0,0.254901960784314,0.415686274509804,1.0,"DarkImperialBlue");
- public static readonly Color DarkJungleGreen = new Color(0.101960784313725,0.141176470588235,0.129411764705882,1.0,"DarkJungleGreen");
- public static readonly Color DarkKhaki = new Color(0.741176470588235,0.717647058823529,0.419607843137255,1.0,"DarkKhaki");
- public static readonly Color DarkLava = new Color(0.282352941176471,0.235294117647059,0.196078431372549,1.0,"DarkLava");
- public static readonly Color DarkLavender = new Color(0.450980392156863,0.309803921568627,0.588235294117647,1.0,"DarkLavender");
- public static readonly Color DarkMagenta = new Color(0.545098039215686,0,0.545098039215686,1.0,"DarkMagenta");
- public static readonly Color DarkMidnightBlue = new Color(0,0.2,0.4,1.0,"DarkMidnightBlue");
- public static readonly Color DarkOliveGreen = new Color(0.333333333333333,0.419607843137255,0.184313725490196,1.0,"DarkOliveGreen");
- public static readonly Color DarkOrange = new Color(1,0.549019607843137,0,1.0,"DarkOrange");
- public static readonly Color DarkOrchid = new Color(0.6,0.196078431372549,0.8,1.0,"DarkOrchid");
- public static readonly Color DarkPastelBlue = new Color(0.466666666666667,0.619607843137255,0.796078431372549,1.0,"DarkPastelBlue");
- public static readonly Color DarkPastelGreen = new Color(0.0117647058823529,0.752941176470588,0.235294117647059,1.0,"DarkPastelGreen");
- public static readonly Color DarkPastelPurple = new Color(0.588235294117647,0.435294117647059,0.83921568627451,1.0,"DarkPastelPurple");
- public static readonly Color DarkPastelRed = new Color(0.76078431372549,0.231372549019608,0.133333333333333,1.0,"DarkPastelRed");
- public static readonly Color DarkPink = new Color(0.905882352941176,0.329411764705882,0.501960784313725,1.0,"DarkPink");
- public static readonly Color DarkPowderBlue = new Color(0,0.2,0.6,1.0,"DarkPowderBlue");
- public static readonly Color DarkRaspberry = new Color(0.529411764705882,0.149019607843137,0.341176470588235,1.0,"DarkRaspberry");
- public static readonly Color DarkRed = new Color(0.545098039215686,0,0,1.0,"DarkRed");
- public static readonly Color DarkSalmon = new Color(0.913725490196078,0.588235294117647,0.47843137254902,1.0,"DarkSalmon");
- public static readonly Color DarkScarlet = new Color(0.337254901960784,0.0117647058823529,0.0980392156862745,1.0,"DarkScarlet");
- public static readonly Color DarkSeaGreen = new Color(0.56078431372549,0.737254901960784,0.56078431372549,1.0,"DarkSeaGreen");
- public static readonly Color DarkSienna = new Color(0.235294117647059,0.0784313725490196,0.0784313725490196,1.0,"DarkSienna");
- public static readonly Color DarkSlateBlue = new Color(0.282352941176471,0.23921568627451,0.545098039215686,1.0,"DarkSlateBlue");
- public static readonly Color DarkSlateGray = new Color(0.184313725490196,0.309803921568627,0.309803921568627,1.0,"DarkSlateGray");
- public static readonly Color DarkSpringGreen = new Color(0.0901960784313725,0.447058823529412,0.270588235294118,1.0,"DarkSpringGreen");
- public static readonly Color DarkTan = new Color(0.568627450980392,0.505882352941176,0.317647058823529,1.0,"DarkTan");
- public static readonly Color DarkTangerine = new Color(1,0.658823529411765,0.0705882352941176,1.0,"DarkTangerine");
- public static readonly Color DarkTaupe = new Color(0.282352941176471,0.235294117647059,0.196078431372549,1.0,"DarkTaupe");
- public static readonly Color DarkTerraCotta = new Color(0.8,0.305882352941176,0.36078431372549,1.0,"DarkTerraCotta");
- public static readonly Color DarkTurquoise = new Color(0,0.807843137254902,0.819607843137255,1.0,"DarkTurquoise");
- public static readonly Color DarkViolet = new Color(0.580392156862745,0,0.827450980392157,1.0,"DarkViolet");
- public static readonly Color DarkYellow = new Color(0.607843137254902,0.529411764705882,0.0470588235294118,1.0,"DarkYellow");
- public static readonly Color DartmouthGreen = new Color(0,0.43921568627451,0.235294117647059,1.0,"DartmouthGreen");
- public static readonly Color DavySGrey = new Color(0.333333333333333,0.333333333333333,0.333333333333333,1.0,"DavySGrey");
- public static readonly Color DebianRed = new Color(0.843137254901961,0.0392156862745098,0.325490196078431,1.0,"DebianRed");
- public static readonly Color DeepCarmine = new Color(0.662745098039216,0.125490196078431,0.243137254901961,1.0,"DeepCarmine");
- public static readonly Color DeepCarminePink = new Color(0.937254901960784,0.188235294117647,0.219607843137255,1.0,"DeepCarminePink");
- public static readonly Color DeepCarrotOrange = new Color(0.913725490196078,0.411764705882353,0.172549019607843,1.0,"DeepCarrotOrange");
- public static readonly Color DeepCerise = new Color(0.854901960784314,0.196078431372549,0.529411764705882,1.0,"DeepCerise");
- public static readonly Color DeepChampagne = new Color(0.980392156862745,0.83921568627451,0.647058823529412,1.0,"DeepChampagne");
- public static readonly Color DeepChestnut = new Color(0.725490196078431,0.305882352941176,0.282352941176471,1.0,"DeepChestnut");
- public static readonly Color DeepCoffee = new Color(0.43921568627451,0.258823529411765,0.254901960784314,1.0,"DeepCoffee");
- public static readonly Color DeepFuchsia = new Color(0.756862745098039,0.329411764705882,0.756862745098039,1.0,"DeepFuchsia");
- public static readonly Color DeepJungleGreen = new Color(0,0.294117647058824,0.286274509803922,1.0,"DeepJungleGreen");
- public static readonly Color DeepLilac = new Color(0.6,0.333333333333333,0.733333333333333,1.0,"DeepLilac");
- public static readonly Color DeepMagenta = new Color(0.8,0,0.8,1.0,"DeepMagenta");
- public static readonly Color DeepPeach = new Color(1,0.796078431372549,0.643137254901961,1.0,"DeepPeach");
- public static readonly Color DeepPink = new Color(1,0.0784313725490196,0.576470588235294,1.0,"DeepPink");
- public static readonly Color DeepRuby = new Color(0.517647058823529,0.247058823529412,0.356862745098039,1.0,"DeepRuby");
- public static readonly Color DeepSaffron = new Color(1,0.6,0.2,1.0,"DeepSaffron");
- public static readonly Color DeepSkyBlue = new Color(0,0.749019607843137,1,1.0,"DeepSkyBlue");
- public static readonly Color DeepTuscanRed = new Color(0.4,0.258823529411765,0.301960784313725,1.0,"DeepTuscanRed");
- public static readonly Color Denim = new Color(0.0823529411764706,0.376470588235294,0.741176470588235,1.0,"Denim");
- public static readonly Color Desert = new Color(0.756862745098039,0.603921568627451,0.419607843137255,1.0,"Desert");
- public static readonly Color DesertSand = new Color(0.929411764705882,0.788235294117647,0.686274509803922,1.0,"DesertSand");
- public static readonly Color DimGray = new Color(0.411764705882353,0.411764705882353,0.411764705882353,1.0,"DimGray");
- public static readonly Color DodgerBlue = new Color(0.117647058823529,0.564705882352941,1,1.0,"DodgerBlue");
- public static readonly Color DogwoodRose = new Color(0.843137254901961,0.0941176470588235,0.407843137254902,1.0,"DogwoodRose");
- public static readonly Color DollarBill = new Color(0.52156862745098,0.733333333333333,0.396078431372549,1.0,"DollarBill");
- public static readonly Color Drab = new Color(0.588235294117647,0.443137254901961,0.0901960784313725,1.0,"Drab");
- public static readonly Color DukeBlue = new Color(0,0,0.611764705882353,1.0,"DukeBlue");
- public static readonly Color EarthYellow = new Color(0.882352941176471,0.662745098039216,0.372549019607843,1.0,"EarthYellow");
- public static readonly Color Ebony = new Color(0.333333333333333,0.364705882352941,0.313725490196078,1.0,"Ebony");
- public static readonly Color Ecru = new Color(0.76078431372549,0.698039215686274,0.501960784313725,1.0,"Ecru");
- public static readonly Color Eggplant = new Color(0.380392156862745,0.250980392156863,0.317647058823529,1.0,"Eggplant");
- public static readonly Color Eggshell = new Color(0.941176470588235,0.917647058823529,0.83921568627451,1.0,"Eggshell");
- public static readonly Color EgyptianBlue = new Color(0.0627450980392157,0.203921568627451,0.650980392156863,1.0,"EgyptianBlue");
- public static readonly Color ElectricBlue = new Color(0.490196078431373,0.976470588235294,1,1.0,"ElectricBlue");
- public static readonly Color ElectricCrimson = new Color(1,0,0.247058823529412,1.0,"ElectricCrimson");
- public static readonly Color ElectricCyan = new Color(0,1,1,1.0,"ElectricCyan");
- public static readonly Color ElectricGreen = new Color(0,1,0,1.0,"ElectricGreen");
- public static readonly Color ElectricIndigo = new Color(0.435294117647059,0,1,1.0,"ElectricIndigo");
- public static readonly Color ElectricLavender = new Color(0.956862745098039,0.733333333333333,1,1.0,"ElectricLavender");
- public static readonly Color ElectricLime = new Color(0.8,1,0,1.0,"ElectricLime");
- public static readonly Color ElectricPurple = new Color(0.749019607843137,0,1,1.0,"ElectricPurple");
- public static readonly Color ElectricUltramarine = new Color(0.247058823529412,0,1,1.0,"ElectricUltramarine");
- public static readonly Color ElectricViolet = new Color(0.56078431372549,0,1,1.0,"ElectricViolet");
- public static readonly Color ElectricYellow = new Color(1,1,0,1.0,"ElectricYellow");
- public static readonly Color Emerald = new Color(0.313725490196078,0.784313725490196,0.470588235294118,1.0,"Emerald");
- public static readonly Color EnglishLavender = new Color(0.705882352941177,0.513725490196078,0.584313725490196,1.0,"EnglishLavender");
- public static readonly Color EtonBlue = new Color(0.588235294117647,0.784313725490196,0.635294117647059,1.0,"EtonBlue");
- public static readonly Color Fallow = new Color(0.756862745098039,0.603921568627451,0.419607843137255,1.0,"Fallow");
- public static readonly Color FaluRed = new Color(0.501960784313725,0.0941176470588235,0.0941176470588235,1.0,"FaluRed");
- public static readonly Color Fandango = new Color(0.709803921568627,0.2,0.537254901960784,1.0,"Fandango");
- public static readonly Color FashionFuchsia = new Color(0.956862745098039,0,0.631372549019608,1.0,"FashionFuchsia");
- public static readonly Color Fawn = new Color(0.898039215686275,0.666666666666667,0.43921568627451,1.0,"Fawn");
- public static readonly Color Feldgrau = new Color(0.301960784313725,0.364705882352941,0.325490196078431,1.0,"Feldgrau");
- public static readonly Color FernGreen = new Color(0.309803921568627,0.474509803921569,0.258823529411765,1.0,"FernGreen");
- public static readonly Color FerrariRed = new Color(1,0.156862745098039,0,1.0,"FerrariRed");
- public static readonly Color FieldDrab = new Color(0.423529411764706,0.329411764705882,0.117647058823529,1.0,"FieldDrab");
- public static readonly Color FireEngineRed = new Color(0.807843137254902,0.125490196078431,0.16078431372549,1.0,"FireEngineRed");
- public static readonly Color Firebrick = new Color(0.698039215686274,0.133333333333333,0.133333333333333,1.0,"Firebrick");
- public static readonly Color Flame = new Color(0.886274509803922,0.345098039215686,0.133333333333333,1.0,"Flame");
- public static readonly Color FlamingoPink = new Color(0.988235294117647,0.556862745098039,0.674509803921569,1.0,"FlamingoPink");
- public static readonly Color Flavescent = new Color(0.968627450980392,0.913725490196078,0.556862745098039,1.0,"Flavescent");
- public static readonly Color Flax = new Color(0.933333333333333,0.862745098039216,0.509803921568627,1.0,"Flax");
- public static readonly Color FloralWhite = new Color(1,0.980392156862745,0.941176470588235,1.0,"FloralWhite");
- public static readonly Color FluorescentOrange = new Color(1,0.749019607843137,0,1.0,"FluorescentOrange");
- public static readonly Color FluorescentPink = new Color(1,0.0784313725490196,0.576470588235294,1.0,"FluorescentPink");
- public static readonly Color FluorescentYellow = new Color(0.8,1,0,1.0,"FluorescentYellow");
- public static readonly Color Folly = new Color(1,0,0.309803921568627,1.0,"Folly");
- public static readonly Color ForestGreenTraditional = new Color(0.00392156862745098,0.266666666666667,0.129411764705882,1.0,"ForestGreenTraditional");
- public static readonly Color ForestGreenWeb = new Color(0.133333333333333,0.545098039215686,0.133333333333333,1.0,"ForestGreenWeb");
- public static readonly Color FrenchBeige = new Color(0.650980392156863,0.482352941176471,0.356862745098039,1.0,"FrenchBeige");
- public static readonly Color FrenchBlue = new Color(0,0.447058823529412,0.733333333333333,1.0,"FrenchBlue");
- public static readonly Color FrenchLilac = new Color(0.525490196078431,0.376470588235294,0.556862745098039,1.0,"FrenchLilac");
- public static readonly Color FrenchLime = new Color(0.8,1,0,1.0,"FrenchLime");
- public static readonly Color FrenchRaspberry = new Color(0.780392156862745,0.172549019607843,0.282352941176471,1.0,"FrenchRaspberry");
- public static readonly Color FrenchRose = new Color(0.964705882352941,0.290196078431373,0.541176470588235,1.0,"FrenchRose");
- public static readonly Color Fuchsia = new Color(1,0,1,1.0,"Fuchsia");
- public static readonly Color FuchsiaCrayola = new Color(0.756862745098039,0.329411764705882,0.756862745098039,1.0,"FuchsiaCrayola");
- public static readonly Color FuchsiaPink = new Color(1,0.466666666666667,1,1.0,"FuchsiaPink");
- public static readonly Color FuchsiaRose = new Color(0.780392156862745,0.262745098039216,0.458823529411765,1.0,"FuchsiaRose");
- public static readonly Color Fulvous = new Color(0.894117647058824,0.517647058823529,0,1.0,"Fulvous");
- public static readonly Color FuzzyWuzzy = new Color(0.8,0.4,0.4,1.0,"FuzzyWuzzy");
- public static readonly Color Gainsboro = new Color(0.862745098039216,0.862745098039216,0.862745098039216,1.0,"Gainsboro");
- public static readonly Color Gamboge = new Color(0.894117647058824,0.607843137254902,0.0588235294117647,1.0,"Gamboge");
- public static readonly Color GhostWhite = new Color(0.972549019607843,0.972549019607843,1,1.0,"GhostWhite");
- public static readonly Color Ginger = new Color(0.690196078431373,0.396078431372549,0,1.0,"Ginger");
- public static readonly Color Glaucous = new Color(0.376470588235294,0.509803921568627,0.713725490196078,1.0,"Glaucous");
- public static readonly Color Glitter = new Color(0.901960784313726,0.909803921568627,0.980392156862745,1.0,"Glitter");
- public static readonly Color GoldMetallic = new Color(0.831372549019608,0.686274509803922,0.215686274509804,1.0,"GoldMetallic");
- public static readonly Color GoldWebGolden = new Color(1,0.843137254901961,0,1.0,"GoldWebGolden");
- public static readonly Color GoldenBrown = new Color(0.6,0.396078431372549,0.0823529411764706,1.0,"GoldenBrown");
- public static readonly Color GoldenPoppy = new Color(0.988235294117647,0.76078431372549,0,1.0,"GoldenPoppy");
- public static readonly Color GoldenYellow = new Color(1,0.874509803921569,0,1.0,"GoldenYellow");
- public static readonly Color Goldenrod = new Color(0.854901960784314,0.647058823529412,0.125490196078431,1.0,"Goldenrod");
- public static readonly Color GrannySmithApple = new Color(0.658823529411765,0.894117647058824,0.627450980392157,1.0,"GrannySmithApple");
- public static readonly Color Gray = new Color(0.501960784313725,0.501960784313725,0.501960784313725,1.0,"Gray");
- public static readonly Color GrayAsparagus = new Color(0.274509803921569,0.349019607843137,0.270588235294118,1.0,"GrayAsparagus");
- public static readonly Color GrayHtmlCssGray = new Color(0.501960784313725,0.501960784313725,0.501960784313725,1.0,"GrayHtmlCssGray");
- public static readonly Color GrayX11Gray = new Color(0.745098039215686,0.745098039215686,0.745098039215686,1.0,"GrayX11Gray");
- public static readonly Color GreenColorWheelX11Green = new Color(0,1,0,1.0,"GreenColorWheelX11Green");
- public static readonly Color GreenCrayola = new Color(0.109803921568627,0.674509803921569,0.470588235294118,1.0,"GreenCrayola");
- public static readonly Color GreenHtmlCssGreen = new Color(0,0.501960784313725,0,1.0,"GreenHtmlCssGreen");
- public static readonly Color GreenMunsell = new Color(0,0.658823529411765,0.466666666666667,1.0,"GreenMunsell");
- public static readonly Color GreenNcs = new Color(0,0.623529411764706,0.419607843137255,1.0,"GreenNcs");
- public static readonly Color GreenPigment = new Color(0,0.647058823529412,0.313725490196078,1.0,"GreenPigment");
- public static readonly Color GreenRyb = new Color(0.4,0.690196078431373,0.196078431372549,1.0,"GreenRyb");
- public static readonly Color GreenYellow = new Color(0.67843137254902,1,0.184313725490196,1.0,"GreenYellow");
- public static readonly Color Grullo = new Color(0.662745098039216,0.603921568627451,0.525490196078431,1.0,"Grullo");
- public static readonly Color GuppieGreen = new Color(0,1,0.498039215686275,1.0,"GuppieGreen");
- public static readonly Color HalayBe = new Color(0.4,0.219607843137255,0.329411764705882,1.0,"HalayBe");
- public static readonly Color HanBlue = new Color(0.266666666666667,0.423529411764706,0.811764705882353,1.0,"HanBlue");
- public static readonly Color HanPurple = new Color(0.32156862745098,0.0941176470588235,0.980392156862745,1.0,"HanPurple");
- public static readonly Color HansaYellow = new Color(0.913725490196078,0.83921568627451,0.419607843137255,1.0,"HansaYellow");
- public static readonly Color Harlequin = new Color(0.247058823529412,1,0,1.0,"Harlequin");
- public static readonly Color HarvardCrimson = new Color(0.788235294117647,0,0.0862745098039216,1.0,"HarvardCrimson");
- public static readonly Color HarvestGold = new Color(0.854901960784314,0.568627450980392,0,1.0,"HarvestGold");
- public static readonly Color HeartGold = new Color(0.501960784313725,0.501960784313725,0,1.0,"HeartGold");
- public static readonly Color Heliotrope = new Color(0.874509803921569,0.450980392156863,1,1.0,"Heliotrope");
- public static readonly Color HollywoodCerise = new Color(0.956862745098039,0,0.631372549019608,1.0,"HollywoodCerise");
- public static readonly Color Honeydew = new Color(0.941176470588235,1,0.941176470588235,1.0,"Honeydew");
- public static readonly Color HonoluluBlue = new Color(0,0.498039215686275,0.749019607843137,1.0,"HonoluluBlue");
- public static readonly Color HookerSGreen = new Color(0.286274509803922,0.474509803921569,0.419607843137255,1.0,"HookerSGreen");
- public static readonly Color HotMagenta = new Color(1,0.113725490196078,0.807843137254902,1.0,"HotMagenta");
- public static readonly Color HotPink = new Color(1,0.411764705882353,0.705882352941177,1.0,"HotPink");
- public static readonly Color HunterGreen = new Color(0.207843137254902,0.368627450980392,0.231372549019608,1.0,"HunterGreen");
- public static readonly Color Iceberg = new Color(0.443137254901961,0.650980392156863,0.823529411764706,1.0,"Iceberg");
- public static readonly Color Icterine = new Color(0.988235294117647,0.968627450980392,0.368627450980392,1.0,"Icterine");
- public static readonly Color ImperialBlue = new Color(0,0.137254901960784,0.584313725490196,1.0,"ImperialBlue");
- public static readonly Color Inchworm = new Color(0.698039215686274,0.925490196078431,0.364705882352941,1.0,"Inchworm");
- public static readonly Color IndiaGreen = new Color(0.0745098039215686,0.533333333333333,0.0313725490196078,1.0,"IndiaGreen");
- public static readonly Color IndianRed = new Color(0.803921568627451,0.36078431372549,0.36078431372549,1.0,"IndianRed");
- public static readonly Color IndianYellow = new Color(0.890196078431373,0.658823529411765,0.341176470588235,1.0,"IndianYellow");
- public static readonly Color Indigo = new Color(0.435294117647059,0,1,1.0,"Indigo");
- public static readonly Color IndigoDye = new Color(0,0.254901960784314,0.415686274509804,1.0,"IndigoDye");
- public static readonly Color IndigoWeb = new Color(0.294117647058824,0,0.509803921568627,1.0,"IndigoWeb");
- public static readonly Color InternationalKleinBlue = new Color(0,0.184313725490196,0.654901960784314,1.0,"InternationalKleinBlue");
- public static readonly Color InternationalOrangeAerospace = new Color(1,0.309803921568627,0,1.0,"InternationalOrangeAerospace");
- public static readonly Color InternationalOrangeEngineering = new Color(0.729411764705882,0.0862745098039216,0.0470588235294118,1.0,"InternationalOrangeEngineering");
- public static readonly Color InternationalOrangeGoldenGateBridge = new Color(0.752941176470588,0.211764705882353,0.172549019607843,1.0,"InternationalOrangeGoldenGateBridge");
- public static readonly Color Iris = new Color(0.352941176470588,0.309803921568627,0.811764705882353,1.0,"Iris");
- public static readonly Color Isabelline = new Color(0.956862745098039,0.941176470588235,0.925490196078431,1.0,"Isabelline");
- public static readonly Color IslamicGreen = new Color(0,0.564705882352941,0,1.0,"IslamicGreen");
- public static readonly Color Ivory = new Color(1,1,0.941176470588235,1.0,"Ivory");
- public static readonly Color Jade = new Color(0,0.658823529411765,0.419607843137255,1.0,"Jade");
- public static readonly Color Jasmine = new Color(0.972549019607843,0.870588235294118,0.494117647058824,1.0,"Jasmine");
- public static readonly Color Jasper = new Color(0.843137254901961,0.231372549019608,0.243137254901961,1.0,"Jasper");
- public static readonly Color JazzberryJam = new Color(0.647058823529412,0.0431372549019608,0.368627450980392,1.0,"JazzberryJam");
- public static readonly Color Jet = new Color(0.203921568627451,0.203921568627451,0.203921568627451,1.0,"Jet");
- public static readonly Color Jonquil = new Color(0.980392156862745,0.854901960784314,0.368627450980392,1.0,"Jonquil");
- public static readonly Color JuneBud = new Color(0.741176470588235,0.854901960784314,0.341176470588235,1.0,"JuneBud");
- public static readonly Color JungleGreen = new Color(0.16078431372549,0.670588235294118,0.529411764705882,1.0,"JungleGreen");
- public static readonly Color KellyGreen = new Color(0.298039215686275,0.733333333333333,0.0901960784313725,1.0,"KellyGreen");
- public static readonly Color KenyanCopper = new Color(0.486274509803922,0.109803921568627,0.0196078431372549,1.0,"KenyanCopper");
- public static readonly Color KhakiHtmlCssKhaki = new Color(0.764705882352941,0.690196078431373,0.568627450980392,1.0,"KhakiHtmlCssKhaki");
- public static readonly Color KhakiX11LightKhaki = new Color(0.941176470588235,0.901960784313726,0.549019607843137,1.0,"KhakiX11LightKhaki");
- public static readonly Color KuCrimson = new Color(0.909803921568627,0,0.0509803921568627,1.0,"KuCrimson");
- public static readonly Color LaSalleGreen = new Color(0.0313725490196078,0.470588235294118,0.188235294117647,1.0,"LaSalleGreen");
- public static readonly Color LanguidLavender = new Color(0.83921568627451,0.792156862745098,0.866666666666667,1.0,"LanguidLavender");
- public static readonly Color LapisLazuli = new Color(0.149019607843137,0.380392156862745,0.611764705882353,1.0,"LapisLazuli");
- public static readonly Color LaserLemon = new Color(0.996078431372549,0.996078431372549,0.133333333333333,1.0,"LaserLemon");
- public static readonly Color LaurelGreen = new Color(0.662745098039216,0.729411764705882,0.615686274509804,1.0,"LaurelGreen");
- public static readonly Color Lava = new Color(0.811764705882353,0.0627450980392157,0.125490196078431,1.0,"Lava");
- public static readonly Color LavenderBlue = new Color(0.8,0.8,1,1.0,"LavenderBlue");
- public static readonly Color LavenderBlush = new Color(1,0.941176470588235,0.96078431372549,1.0,"LavenderBlush");
- public static readonly Color LavenderFloral = new Color(0.709803921568627,0.494117647058824,0.862745098039216,1.0,"LavenderFloral");
- public static readonly Color LavenderGray = new Color(0.768627450980392,0.764705882352941,0.815686274509804,1.0,"LavenderGray");
- public static readonly Color LavenderIndigo = new Color(0.580392156862745,0.341176470588235,0.92156862745098,1.0,"LavenderIndigo");
- public static readonly Color LavenderMagenta = new Color(0.933333333333333,0.509803921568627,0.933333333333333,1.0,"LavenderMagenta");
- public static readonly Color LavenderMist = new Color(0.901960784313726,0.901960784313726,0.980392156862745,1.0,"LavenderMist");
- public static readonly Color LavenderPink = new Color(0.984313725490196,0.682352941176471,0.823529411764706,1.0,"LavenderPink");
- public static readonly Color LavenderPurple = new Color(0.588235294117647,0.482352941176471,0.713725490196078,1.0,"LavenderPurple");
- public static readonly Color LavenderRose = new Color(0.984313725490196,0.627450980392157,0.890196078431373,1.0,"LavenderRose");
- public static readonly Color LavenderWeb = new Color(0.901960784313726,0.901960784313726,0.980392156862745,1.0,"LavenderWeb");
- public static readonly Color LawnGreen = new Color(0.486274509803922,0.988235294117647,0,1.0,"LawnGreen");
- public static readonly Color Lemon = new Color(1,0.968627450980392,0,1.0,"Lemon");
- public static readonly Color LemonChiffon = new Color(1,0.980392156862745,0.803921568627451,1.0,"LemonChiffon");
- public static readonly Color LemonLime = new Color(0.890196078431373,1,0,1.0,"LemonLime");
- public static readonly Color Licorice = new Color(0.101960784313725,0.0666666666666667,0.0627450980392157,1.0,"Licorice");
- public static readonly Color LightApricot = new Color(0.992156862745098,0.835294117647059,0.694117647058824,1.0,"LightApricot");
- public static readonly Color LightBlue = new Color(0.67843137254902,0.847058823529412,0.901960784313726,1.0,"LightBlue");
- public static readonly Color LightBrown = new Color(0.709803921568627,0.396078431372549,0.113725490196078,1.0,"LightBrown");
- public static readonly Color LightCarminePink = new Color(0.901960784313726,0.403921568627451,0.443137254901961,1.0,"LightCarminePink");
- public static readonly Color LightCoral = new Color(0.941176470588235,0.501960784313725,0.501960784313725,1.0,"LightCoral");
- public static readonly Color LightCornflowerBlue = new Color(0.576470588235294,0.8,0.917647058823529,1.0,"LightCornflowerBlue");
- public static readonly Color LightCrimson = new Color(0.96078431372549,0.411764705882353,0.568627450980392,1.0,"LightCrimson");
- public static readonly Color LightCyan = new Color(0.87843137254902,1,1,1.0,"LightCyan");
- public static readonly Color LightFuchsiaPink = new Color(0.976470588235294,0.517647058823529,0.937254901960784,1.0,"LightFuchsiaPink");
- public static readonly Color LightGoldenrodYellow = new Color(0.980392156862745,0.980392156862745,0.823529411764706,1.0,"LightGoldenrodYellow");
- public static readonly Color LightGray = new Color(0.827450980392157,0.827450980392157,0.827450980392157,1.0,"LightGray");
- public static readonly Color LightGreen = new Color(0.564705882352941,0.933333333333333,0.564705882352941,1.0,"LightGreen");
- public static readonly Color LightKhaki = new Color(0.941176470588235,0.901960784313726,0.549019607843137,1.0,"LightKhaki");
- public static readonly Color LightPastelPurple = new Color(0.694117647058824,0.611764705882353,0.850980392156863,1.0,"LightPastelPurple");
- public static readonly Color LightPink = new Color(1,0.713725490196078,0.756862745098039,1.0,"LightPink");
- public static readonly Color LightRedOchre = new Color(0.913725490196078,0.454901960784314,0.317647058823529,1.0,"LightRedOchre");
- public static readonly Color LightSalmon = new Color(1,0.627450980392157,0.47843137254902,1.0,"LightSalmon");
- public static readonly Color LightSalmonPink = new Color(1,0.6,0.6,1.0,"LightSalmonPink");
- public static readonly Color LightSeaGreen = new Color(0.125490196078431,0.698039215686274,0.666666666666667,1.0,"LightSeaGreen");
- public static readonly Color LightSkyBlue = new Color(0.529411764705882,0.807843137254902,0.980392156862745,1.0,"LightSkyBlue");
- public static readonly Color LightSlateGray = new Color(0.466666666666667,0.533333333333333,0.6,1.0,"LightSlateGray");
- public static readonly Color LightTaupe = new Color(0.701960784313725,0.545098039215686,0.427450980392157,1.0,"LightTaupe");
- public static readonly Color LightThulianPink = new Color(0.901960784313726,0.56078431372549,0.674509803921569,1.0,"LightThulianPink");
- public static readonly Color LightYellow = new Color(1,1,0.87843137254902,1.0,"LightYellow");
- public static readonly Color Lilac = new Color(0.784313725490196,0.635294117647059,0.784313725490196,1.0,"Lilac");
- public static readonly Color LimeColorWheel = new Color(0.749019607843137,1,0,1.0,"LimeColorWheel");
- public static readonly Color LimeGreen = new Color(0.196078431372549,0.803921568627451,0.196078431372549,1.0,"LimeGreen");
- public static readonly Color LimeWebX11Green = new Color(0,1,0,1.0,"LimeWebX11Green");
- public static readonly Color Limerick = new Color(0.615686274509804,0.76078431372549,0.0352941176470588,1.0,"Limerick");
- public static readonly Color LincolnGreen = new Color(0.0980392156862745,0.349019607843137,0.0196078431372549,1.0,"LincolnGreen");
- public static readonly Color Linen = new Color(0.980392156862745,0.941176470588235,0.901960784313726,1.0,"Linen");
- public static readonly Color Lion = new Color(0.756862745098039,0.603921568627451,0.419607843137255,1.0,"Lion");
- public static readonly Color LittleBoyBlue = new Color(0.423529411764706,0.627450980392157,0.862745098039216,1.0,"LittleBoyBlue");
- public static readonly Color Liver = new Color(0.325490196078431,0.294117647058824,0.309803921568627,1.0,"Liver");
- public static readonly Color Lust = new Color(0.901960784313726,0.125490196078431,0.125490196078431,1.0,"Lust");
- public static readonly Color Magenta = new Color(1,0,1,1.0,"Magenta");
- public static readonly Color MagentaDye = new Color(0.792156862745098,0.12156862745098,0.482352941176471,1.0,"MagentaDye");
- public static readonly Color MagentaProcess = new Color(1,0,0.564705882352941,1.0,"MagentaProcess");
- public static readonly Color MagicMint = new Color(0.666666666666667,0.941176470588235,0.819607843137255,1.0,"MagicMint");
- public static readonly Color Magnolia = new Color(0.972549019607843,0.956862745098039,1,1.0,"Magnolia");
- public static readonly Color Mahogany = new Color(0.752941176470588,0.250980392156863,0,1.0,"Mahogany");
- public static readonly Color Maize = new Color(0.984313725490196,0.925490196078431,0.364705882352941,1.0,"Maize");
- public static readonly Color MajorelleBlue = new Color(0.376470588235294,0.313725490196078,0.862745098039216,1.0,"MajorelleBlue");
- public static readonly Color Malachite = new Color(0.0431372549019608,0.854901960784314,0.317647058823529,1.0,"Malachite");
- public static readonly Color Manatee = new Color(0.592156862745098,0.603921568627451,0.666666666666667,1.0,"Manatee");
- public static readonly Color MangoTango = new Color(1,0.509803921568627,0.262745098039216,1.0,"MangoTango");
- public static readonly Color Mantis = new Color(0.454901960784314,0.764705882352941,0.396078431372549,1.0,"Mantis");
- public static readonly Color MardiGras = new Color(0.533333333333333,0,0.52156862745098,1.0,"MardiGras");
- public static readonly Color MaroonCrayola = new Color(0.764705882352941,0.129411764705882,0.282352941176471,1.0,"MaroonCrayola");
- public static readonly Color MaroonHtmlCss = new Color(0.501960784313725,0,0,1.0,"MaroonHtmlCss");
- public static readonly Color MaroonX11 = new Color(0.690196078431373,0.188235294117647,0.376470588235294,1.0,"MaroonX11");
- public static readonly Color Mauve = new Color(0.87843137254902,0.690196078431373,1,1.0,"Mauve");
- public static readonly Color MauveTaupe = new Color(0.568627450980392,0.372549019607843,0.427450980392157,1.0,"MauveTaupe");
- public static readonly Color Mauvelous = new Color(0.937254901960784,0.596078431372549,0.666666666666667,1.0,"Mauvelous");
- public static readonly Color MayaBlue = new Color(0.450980392156863,0.76078431372549,0.984313725490196,1.0,"MayaBlue");
- public static readonly Color MeatBrown = new Color(0.898039215686275,0.717647058823529,0.231372549019608,1.0,"MeatBrown");
- public static readonly Color MediumAquamarine = new Color(0.4,0.866666666666667,0.666666666666667,1.0,"MediumAquamarine");
- public static readonly Color MediumBlue = new Color(0,0,0.803921568627451,1.0,"MediumBlue");
- public static readonly Color MediumCandyAppleRed = new Color(0.886274509803922,0.0235294117647059,0.172549019607843,1.0,"MediumCandyAppleRed");
- public static readonly Color MediumCarmine = new Color(0.686274509803922,0.250980392156863,0.207843137254902,1.0,"MediumCarmine");
- public static readonly Color MediumChampagne = new Color(0.952941176470588,0.898039215686275,0.670588235294118,1.0,"MediumChampagne");
- public static readonly Color MediumElectricBlue = new Color(0.0117647058823529,0.313725490196078,0.588235294117647,1.0,"MediumElectricBlue");
- public static readonly Color MediumJungleGreen = new Color(0.109803921568627,0.207843137254902,0.176470588235294,1.0,"MediumJungleGreen");
- public static readonly Color MediumLavenderMagenta = new Color(0.866666666666667,0.627450980392157,0.866666666666667,1.0,"MediumLavenderMagenta");
- public static readonly Color MediumOrchid = new Color(0.729411764705882,0.333333333333333,0.827450980392157,1.0,"MediumOrchid");
- public static readonly Color MediumPersianBlue = new Color(0,0.403921568627451,0.647058823529412,1.0,"MediumPersianBlue");
- public static readonly Color MediumPurple = new Color(0.576470588235294,0.43921568627451,0.858823529411765,1.0,"MediumPurple");
- public static readonly Color MediumRedViolet = new Color(0.733333333333333,0.2,0.52156862745098,1.0,"MediumRedViolet");
- public static readonly Color MediumRuby = new Color(0.666666666666667,0.250980392156863,0.411764705882353,1.0,"MediumRuby");
- public static readonly Color MediumSeaGreen = new Color(0.235294117647059,0.701960784313725,0.443137254901961,1.0,"MediumSeaGreen");
- public static readonly Color MediumSlateBlue = new Color(0.482352941176471,0.407843137254902,0.933333333333333,1.0,"MediumSlateBlue");
- public static readonly Color MediumSpringBud = new Color(0.788235294117647,0.862745098039216,0.529411764705882,1.0,"MediumSpringBud");
- public static readonly Color MediumSpringGreen = new Color(0,0.980392156862745,0.603921568627451,1.0,"MediumSpringGreen");
- public static readonly Color MediumTaupe = new Color(0.403921568627451,0.298039215686275,0.27843137254902,1.0,"MediumTaupe");
- public static readonly Color MediumTurquoise = new Color(0.282352941176471,0.819607843137255,0.8,1.0,"MediumTurquoise");
- public static readonly Color MediumTuscanRed = new Color(0.474509803921569,0.266666666666667,0.231372549019608,1.0,"MediumTuscanRed");
- public static readonly Color MediumVermilion = new Color(0.850980392156863,0.376470588235294,0.231372549019608,1.0,"MediumVermilion");
- public static readonly Color MediumVioletRed = new Color(0.780392156862745,0.0823529411764706,0.52156862745098,1.0,"MediumVioletRed");
- public static readonly Color MellowApricot = new Color(0.972549019607843,0.72156862745098,0.470588235294118,1.0,"MellowApricot");
- public static readonly Color MellowYellow = new Color(0.972549019607843,0.870588235294118,0.494117647058824,1.0,"MellowYellow");
- public static readonly Color Melon = new Color(0.992156862745098,0.737254901960784,0.705882352941177,1.0,"Melon");
- public static readonly Color MidnightBlue = new Color(0.0980392156862745,0.0980392156862745,0.43921568627451,1.0,"MidnightBlue");
- public static readonly Color MidnightGreenEagleGreen = new Color(0,0.286274509803922,0.325490196078431,1.0,"MidnightGreenEagleGreen");
- public static readonly Color MikadoYellow = new Color(1,0.768627450980392,0.0470588235294118,1.0,"MikadoYellow");
- public static readonly Color Mint = new Color(0.243137254901961,0.705882352941177,0.537254901960784,1.0,"Mint");
- public static readonly Color MintCream = new Color(0.96078431372549,1,0.980392156862745,1.0,"MintCream");
- public static readonly Color MintGreen = new Color(0.596078431372549,1,0.596078431372549,1.0,"MintGreen");
- public static readonly Color MistyRose = new Color(1,0.894117647058824,0.882352941176471,1.0,"MistyRose");
- public static readonly Color Moccasin = new Color(0.980392156862745,0.92156862745098,0.843137254901961,1.0,"Moccasin");
- public static readonly Color ModeBeige = new Color(0.588235294117647,0.443137254901961,0.0901960784313725,1.0,"ModeBeige");
- public static readonly Color MoonstoneBlue = new Color(0.450980392156863,0.662745098039216,0.76078431372549,1.0,"MoonstoneBlue");
- public static readonly Color MordantRed19 = new Color(0.682352941176471,0.0470588235294118,0,1.0,"MordantRed19");
- public static readonly Color MossGreen = new Color(0.67843137254902,0.874509803921569,0.67843137254902,1.0,"MossGreen");
- public static readonly Color MountainMeadow = new Color(0.188235294117647,0.729411764705882,0.56078431372549,1.0,"MountainMeadow");
- public static readonly Color MountbattenPink = new Color(0.6,0.47843137254902,0.552941176470588,1.0,"MountbattenPink");
- public static readonly Color MsuGreen = new Color(0.0941176470588235,0.270588235294118,0.231372549019608,1.0,"MsuGreen");
- public static readonly Color Mulberry = new Color(0.772549019607843,0.294117647058824,0.549019607843137,1.0,"Mulberry");
- public static readonly Color Mustard = new Color(1,0.858823529411765,0.345098039215686,1.0,"Mustard");
- public static readonly Color Myrtle = new Color(0.129411764705882,0.258823529411765,0.117647058823529,1.0,"Myrtle");
- public static readonly Color NadeshikoPink = new Color(0.964705882352941,0.67843137254902,0.776470588235294,1.0,"NadeshikoPink");
- public static readonly Color NapierGreen = new Color(0.164705882352941,0.501960784313725,0,1.0,"NapierGreen");
- public static readonly Color NaplesYellow = new Color(0.980392156862745,0.854901960784314,0.368627450980392,1.0,"NaplesYellow");
- public static readonly Color NavajoWhite = new Color(1,0.870588235294118,0.67843137254902,1.0,"NavajoWhite");
- public static readonly Color NavyBlue = new Color(0,0,0.501960784313725,1.0,"NavyBlue");
- public static readonly Color NeonCarrot = new Color(1,0.63921568627451,0.262745098039216,1.0,"NeonCarrot");
- public static readonly Color NeonFuchsia = new Color(0.996078431372549,0.254901960784314,0.392156862745098,1.0,"NeonFuchsia");
- public static readonly Color NeonGreen = new Color(0.223529411764706,1,0.0784313725490196,1.0,"NeonGreen");
- public static readonly Color NewYorkPink = new Color(0.843137254901961,0.513725490196078,0.498039215686275,1.0,"NewYorkPink");
- public static readonly Color NonPhotoBlue = new Color(0.643137254901961,0.866666666666667,0.929411764705882,1.0,"NonPhotoBlue");
- public static readonly Color NorthTexasGreen = new Color(0.0196078431372549,0.564705882352941,0.2,1.0,"NorthTexasGreen");
- public static readonly Color OceanBoatBlue = new Color(0,0.466666666666667,0.745098039215686,1.0,"OceanBoatBlue");
- public static readonly Color Ochre = new Color(0.8,0.466666666666667,0.133333333333333,1.0,"Ochre");
- public static readonly Color OfficeGreen = new Color(0,0.501960784313725,0,1.0,"OfficeGreen");
- public static readonly Color OldGold = new Color(0.811764705882353,0.709803921568627,0.231372549019608,1.0,"OldGold");
- public static readonly Color OldLace = new Color(0.992156862745098,0.96078431372549,0.901960784313726,1.0,"OldLace");
- public static readonly Color OldLavender = new Color(0.474509803921569,0.407843137254902,0.470588235294118,1.0,"OldLavender");
- public static readonly Color OldMauve = new Color(0.403921568627451,0.192156862745098,0.27843137254902,1.0,"OldMauve");
- public static readonly Color OldRose = new Color(0.752941176470588,0.501960784313725,0.505882352941176,1.0,"OldRose");
- public static readonly Color Olive = new Color(0.501960784313725,0.501960784313725,0,1.0,"Olive");
- public static readonly Color OliveDrab7 = new Color(0.235294117647059,0.203921568627451,0.12156862745098,1.0,"OliveDrab7");
- public static readonly Color OliveDrabWebOliveDrab3 = new Color(0.419607843137255,0.556862745098039,0.137254901960784,1.0,"OliveDrabWebOliveDrab3");
- public static readonly Color Olivine = new Color(0.603921568627451,0.725490196078431,0.450980392156863,1.0,"Olivine");
- public static readonly Color Onyx = new Color(0.207843137254902,0.219607843137255,0.223529411764706,1.0,"Onyx");
- public static readonly Color OperaMauve = new Color(0.717647058823529,0.517647058823529,0.654901960784314,1.0,"OperaMauve");
- public static readonly Color OrangeColorWheel = new Color(1,0.498039215686275,0,1.0,"OrangeColorWheel");
- public static readonly Color OrangePeel = new Color(1,0.623529411764706,0,1.0,"OrangePeel");
- public static readonly Color OrangeRed = new Color(1,0.270588235294118,0,1.0,"OrangeRed");
- public static readonly Color OrangeRyb = new Color(0.984313725490196,0.6,0.00784313725490196,1.0,"OrangeRyb");
- public static readonly Color OrangeWebColor = new Color(1,0.647058823529412,0,1.0,"OrangeWebColor");
- public static readonly Color Orchid = new Color(0.854901960784314,0.43921568627451,0.83921568627451,1.0,"Orchid");
- public static readonly Color OtterBrown = new Color(0.396078431372549,0.262745098039216,0.129411764705882,1.0,"OtterBrown");
- public static readonly Color OuCrimsonRed = new Color(0.6,0,0,1.0,"OuCrimsonRed");
- public static readonly Color OuterSpace = new Color(0.254901960784314,0.290196078431373,0.298039215686275,1.0,"OuterSpace");
- public static readonly Color OutrageousOrange = new Color(1,0.431372549019608,0.290196078431373,1.0,"OutrageousOrange");
- public static readonly Color OxfordBlue = new Color(0,0.129411764705882,0.27843137254902,1.0,"OxfordBlue");
- public static readonly Color PakistanGreen = new Color(0,0.4,0,1.0,"PakistanGreen");
- public static readonly Color PalatinateBlue = new Color(0.152941176470588,0.231372549019608,0.886274509803922,1.0,"PalatinateBlue");
- public static readonly Color PalatinatePurple = new Color(0.407843137254902,0.156862745098039,0.376470588235294,1.0,"PalatinatePurple");
- public static readonly Color PaleAqua = new Color(0.737254901960784,0.831372549019608,0.901960784313726,1.0,"PaleAqua");
- public static readonly Color PaleBlue = new Color(0.686274509803922,0.933333333333333,0.933333333333333,1.0,"PaleBlue");
- public static readonly Color PaleBrown = new Color(0.596078431372549,0.462745098039216,0.329411764705882,1.0,"PaleBrown");
- public static readonly Color PaleCarmine = new Color(0.686274509803922,0.250980392156863,0.207843137254902,1.0,"PaleCarmine");
- public static readonly Color PaleCerulean = new Color(0.607843137254902,0.768627450980392,0.886274509803922,1.0,"PaleCerulean");
- public static readonly Color PaleChestnut = new Color(0.866666666666667,0.67843137254902,0.686274509803922,1.0,"PaleChestnut");
- public static readonly Color PaleCopper = new Color(0.854901960784314,0.541176470588235,0.403921568627451,1.0,"PaleCopper");
- public static readonly Color PaleCornflowerBlue = new Color(0.670588235294118,0.803921568627451,0.937254901960784,1.0,"PaleCornflowerBlue");
- public static readonly Color PaleGold = new Color(0.901960784313726,0.745098039215686,0.541176470588235,1.0,"PaleGold");
- public static readonly Color PaleGoldenrod = new Color(0.933333333333333,0.909803921568627,0.666666666666667,1.0,"PaleGoldenrod");
- public static readonly Color PaleGreen = new Color(0.596078431372549,0.984313725490196,0.596078431372549,1.0,"PaleGreen");
- public static readonly Color PaleLavender = new Color(0.862745098039216,0.815686274509804,1,1.0,"PaleLavender");
- public static readonly Color PaleMagenta = new Color(0.976470588235294,0.517647058823529,0.898039215686275,1.0,"PaleMagenta");
- public static readonly Color PalePink = new Color(0.980392156862745,0.854901960784314,0.866666666666667,1.0,"PalePink");
- public static readonly Color PalePlum = new Color(0.866666666666667,0.627450980392157,0.866666666666667,1.0,"PalePlum");
- public static readonly Color PaleRedViolet = new Color(0.858823529411765,0.43921568627451,0.576470588235294,1.0,"PaleRedViolet");
- public static readonly Color PaleRobinEggBlue = new Color(0.588235294117647,0.870588235294118,0.819607843137255,1.0,"PaleRobinEggBlue");
- public static readonly Color PaleSilver = new Color(0.788235294117647,0.752941176470588,0.733333333333333,1.0,"PaleSilver");
- public static readonly Color PaleSpringBud = new Color(0.925490196078431,0.92156862745098,0.741176470588235,1.0,"PaleSpringBud");
- public static readonly Color PaleTaupe = new Color(0.737254901960784,0.596078431372549,0.494117647058824,1.0,"PaleTaupe");
- public static readonly Color PaleVioletRed = new Color(0.858823529411765,0.43921568627451,0.576470588235294,1.0,"PaleVioletRed");
- public static readonly Color PansyPurple = new Color(0.470588235294118,0.0941176470588235,0.290196078431373,1.0,"PansyPurple");
- public static readonly Color PapayaWhip = new Color(1,0.937254901960784,0.835294117647059,1.0,"PapayaWhip");
- public static readonly Color ParisGreen = new Color(0.313725490196078,0.784313725490196,0.470588235294118,1.0,"ParisGreen");
- public static readonly Color PastelBlue = new Color(0.682352941176471,0.776470588235294,0.811764705882353,1.0,"PastelBlue");
- public static readonly Color PastelBrown = new Color(0.513725490196078,0.411764705882353,0.325490196078431,1.0,"PastelBrown");
- public static readonly Color PastelGray = new Color(0.811764705882353,0.811764705882353,0.768627450980392,1.0,"PastelGray");
- public static readonly Color PastelGreen = new Color(0.466666666666667,0.866666666666667,0.466666666666667,1.0,"PastelGreen");
- public static readonly Color PastelMagenta = new Color(0.956862745098039,0.603921568627451,0.76078431372549,1.0,"PastelMagenta");
- public static readonly Color PastelOrange = new Color(1,0.701960784313725,0.27843137254902,1.0,"PastelOrange");
- public static readonly Color PastelPink = new Color(0.870588235294118,0.647058823529412,0.643137254901961,1.0,"PastelPink");
- public static readonly Color PastelPurple = new Color(0.701960784313725,0.619607843137255,0.709803921568627,1.0,"PastelPurple");
- public static readonly Color PastelRed = new Color(1,0.411764705882353,0.380392156862745,1.0,"PastelRed");
- public static readonly Color PastelViolet = new Color(0.796078431372549,0.6,0.788235294117647,1.0,"PastelViolet");
- public static readonly Color PastelYellow = new Color(0.992156862745098,0.992156862745098,0.588235294117647,1.0,"PastelYellow");
- public static readonly Color Patriarch = new Color(0.501960784313725,0,0.501960784313725,1.0,"Patriarch");
- public static readonly Color PayneSGrey = new Color(0.325490196078431,0.407843137254902,0.470588235294118,1.0,"PayneSGrey");
- public static readonly Color Peach = new Color(1,0.898039215686275,0.705882352941177,1.0,"Peach");
- public static readonly Color PeachCrayola = new Color(1,0.796078431372549,0.643137254901961,1.0,"PeachCrayola");
- public static readonly Color PeachOrange = new Color(1,0.8,0.6,1.0,"PeachOrange");
- public static readonly Color PeachPuff = new Color(1,0.854901960784314,0.725490196078431,1.0,"PeachPuff");
- public static readonly Color PeachYellow = new Color(0.980392156862745,0.874509803921569,0.67843137254902,1.0,"PeachYellow");
- public static readonly Color Pear = new Color(0.819607843137255,0.886274509803922,0.192156862745098,1.0,"Pear");
- public static readonly Color Pearl = new Color(0.917647058823529,0.87843137254902,0.784313725490196,1.0,"Pearl");
- public static readonly Color PearlAqua = new Color(0.533333333333333,0.847058823529412,0.752941176470588,1.0,"PearlAqua");
- public static readonly Color PearlyPurple = new Color(0.717647058823529,0.407843137254902,0.635294117647059,1.0,"PearlyPurple");
- public static readonly Color Peridot = new Color(0.901960784313726,0.886274509803922,0,1.0,"Peridot");
- public static readonly Color Periwinkle = new Color(0.8,0.8,1,1.0,"Periwinkle");
- public static readonly Color PersianBlue = new Color(0.109803921568627,0.223529411764706,0.733333333333333,1.0,"PersianBlue");
- public static readonly Color PersianGreen = new Color(0,0.650980392156863,0.576470588235294,1.0,"PersianGreen");
- public static readonly Color PersianIndigo = new Color(0.196078431372549,0.0705882352941176,0.47843137254902,1.0,"PersianIndigo");
- public static readonly Color PersianOrange = new Color(0.850980392156863,0.564705882352941,0.345098039215686,1.0,"PersianOrange");
- public static readonly Color PersianPink = new Color(0.968627450980392,0.498039215686275,0.745098039215686,1.0,"PersianPink");
- public static readonly Color PersianPlum = new Color(0.43921568627451,0.109803921568627,0.109803921568627,1.0,"PersianPlum");
- public static readonly Color PersianRed = new Color(0.8,0.2,0.2,1.0,"PersianRed");
- public static readonly Color PersianRose = new Color(0.996078431372549,0.156862745098039,0.635294117647059,1.0,"PersianRose");
- public static readonly Color Persimmon = new Color(0.925490196078431,0.345098039215686,0,1.0,"Persimmon");
- public static readonly Color Peru = new Color(0.803921568627451,0.52156862745098,0.247058823529412,1.0,"Peru");
- public static readonly Color Phlox = new Color(0.874509803921569,0,1,1.0,"Phlox");
- public static readonly Color PhthaloBlue = new Color(0,0.0588235294117647,0.537254901960784,1.0,"PhthaloBlue");
- public static readonly Color PhthaloGreen = new Color(0.0705882352941176,0.207843137254902,0.141176470588235,1.0,"PhthaloGreen");
- public static readonly Color PiggyPink = new Color(0.992156862745098,0.866666666666667,0.901960784313726,1.0,"PiggyPink");
- public static readonly Color PineGreen = new Color(0.00392156862745098,0.474509803921569,0.435294117647059,1.0,"PineGreen");
- public static readonly Color Pink = new Color(1,0.752941176470588,0.796078431372549,1.0,"Pink");
- public static readonly Color PinkLace = new Color(1,0.866666666666667,0.956862745098039,1.0,"PinkLace");
- public static readonly Color PinkOrange = new Color(1,0.6,0.4,1.0,"PinkOrange");
- public static readonly Color PinkPearl = new Color(0.905882352941176,0.674509803921569,0.811764705882353,1.0,"PinkPearl");
- public static readonly Color PinkSherbet = new Color(0.968627450980392,0.56078431372549,0.654901960784314,1.0,"PinkSherbet");
- public static readonly Color Pistachio = new Color(0.576470588235294,0.772549019607843,0.447058823529412,1.0,"Pistachio");
- public static readonly Color Platinum = new Color(0.898039215686275,0.894117647058824,0.886274509803922,1.0,"Platinum");
- public static readonly Color PlumTraditional = new Color(0.556862745098039,0.270588235294118,0.52156862745098,1.0,"PlumTraditional");
- public static readonly Color PlumWeb = new Color(0.866666666666667,0.627450980392157,0.866666666666667,1.0,"PlumWeb");
- public static readonly Color PortlandOrange = new Color(1,0.352941176470588,0.211764705882353,1.0,"PortlandOrange");
- public static readonly Color PowderBlueWeb = new Color(0.690196078431373,0.87843137254902,0.901960784313726,1.0,"PowderBlueWeb");
- public static readonly Color PrincetonOrange = new Color(1,0.56078431372549,0,1.0,"PrincetonOrange");
- public static readonly Color Prune = new Color(0.43921568627451,0.109803921568627,0.109803921568627,1.0,"Prune");
- public static readonly Color PrussianBlue = new Color(0,0.192156862745098,0.325490196078431,1.0,"PrussianBlue");
- public static readonly Color PsychedelicPurple = new Color(0.874509803921569,0,1,1.0,"PsychedelicPurple");
- public static readonly Color Puce = new Color(0.8,0.533333333333333,0.6,1.0,"Puce");
- public static readonly Color Pumpkin = new Color(1,0.458823529411765,0.0941176470588235,1.0,"Pumpkin");
- public static readonly Color PurpleHeart = new Color(0.411764705882353,0.207843137254902,0.611764705882353,1.0,"PurpleHeart");
- public static readonly Color PurpleHtmlCss = new Color(0.501960784313725,0,0.501960784313725,1.0,"PurpleHtmlCss");
- public static readonly Color PurpleMountainMajesty = new Color(0.588235294117647,0.470588235294118,0.713725490196078,1.0,"PurpleMountainMajesty");
- public static readonly Color PurpleMunsell = new Color(0.623529411764706,0,0.772549019607843,1.0,"PurpleMunsell");
- public static readonly Color PurplePizzazz = new Color(0.996078431372549,0.305882352941176,0.854901960784314,1.0,"PurplePizzazz");
- public static readonly Color PurpleTaupe = new Color(0.313725490196078,0.250980392156863,0.301960784313725,1.0,"PurpleTaupe");
- public static readonly Color PurpleX11 = new Color(0.627450980392157,0.125490196078431,0.941176470588235,1.0,"PurpleX11");
- public static readonly Color Quartz = new Color(0.317647058823529,0.282352941176471,0.309803921568627,1.0,"Quartz");
- public static readonly Color Rackley = new Color(0.364705882352941,0.541176470588235,0.658823529411765,1.0,"Rackley");
- public static readonly Color RadicalRed = new Color(1,0.207843137254902,0.368627450980392,1.0,"RadicalRed");
- public static readonly Color Rajah = new Color(0.984313725490196,0.670588235294118,0.376470588235294,1.0,"Rajah");
- public static readonly Color Raspberry = new Color(0.890196078431373,0.0431372549019608,0.364705882352941,1.0,"Raspberry");
- public static readonly Color RaspberryGlace = new Color(0.568627450980392,0.372549019607843,0.427450980392157,1.0,"RaspberryGlace");
- public static readonly Color RaspberryPink = new Color(0.886274509803922,0.313725490196078,0.596078431372549,1.0,"RaspberryPink");
- public static readonly Color RaspberryRose = new Color(0.701960784313725,0.266666666666667,0.423529411764706,1.0,"RaspberryRose");
- public static readonly Color RawUmber = new Color(0.509803921568627,0.4,0.266666666666667,1.0,"RawUmber");
- public static readonly Color RazzleDazzleRose = new Color(1,0.2,0.8,1.0,"RazzleDazzleRose");
- public static readonly Color Razzmatazz = new Color(0.890196078431373,0.145098039215686,0.419607843137255,1.0,"Razzmatazz");
- public static readonly Color Red = new Color(1,0,0,1.0,"Red");
- public static readonly Color RedBrown = new Color(0.647058823529412,0.164705882352941,0.164705882352941,1.0,"RedBrown");
- public static readonly Color RedDevil = new Color(0.525490196078431,0.00392156862745098,0.0666666666666667,1.0,"RedDevil");
- public static readonly Color RedMunsell = new Color(0.949019607843137,0,0.235294117647059,1.0,"RedMunsell");
- public static readonly Color RedNcs = new Color(0.768627450980392,0.00784313725490196,0.2,1.0,"RedNcs");
- public static readonly Color RedOrange = new Color(1,0.325490196078431,0.286274509803922,1.0,"RedOrange");
- public static readonly Color RedPigment = new Color(0.929411764705882,0.109803921568627,0.141176470588235,1.0,"RedPigment");
- public static readonly Color RedRyb = new Color(0.996078431372549,0.152941176470588,0.0705882352941176,1.0,"RedRyb");
- public static readonly Color RedViolet = new Color(0.780392156862745,0.0823529411764706,0.52156862745098,1.0,"RedViolet");
- public static readonly Color Redwood = new Color(0.670588235294118,0.305882352941176,0.32156862745098,1.0,"Redwood");
- public static readonly Color Regalia = new Color(0.32156862745098,0.176470588235294,0.501960784313725,1.0,"Regalia");
- public static readonly Color ResolutionBlue = new Color(0,0.137254901960784,0.529411764705882,1.0,"ResolutionBlue");
- public static readonly Color RichBlack = new Color(0,0.250980392156863,0.250980392156863,1.0,"RichBlack");
- public static readonly Color RichBrilliantLavender = new Color(0.945098039215686,0.654901960784314,0.996078431372549,1.0,"RichBrilliantLavender");
- public static readonly Color RichCarmine = new Color(0.843137254901961,0,0.250980392156863,1.0,"RichCarmine");
- public static readonly Color RichElectricBlue = new Color(0.0313725490196078,0.572549019607843,0.815686274509804,1.0,"RichElectricBlue");
- public static readonly Color RichLavender = new Color(0.654901960784314,0.419607843137255,0.811764705882353,1.0,"RichLavender");
- public static readonly Color RichLilac = new Color(0.713725490196078,0.4,0.823529411764706,1.0,"RichLilac");
- public static readonly Color RichMaroon = new Color(0.690196078431373,0.188235294117647,0.376470588235294,1.0,"RichMaroon");
- public static readonly Color RifleGreen = new Color(0.254901960784314,0.282352941176471,0.2,1.0,"RifleGreen");
- public static readonly Color RobinEggBlue = new Color(0,0.8,0.8,1.0,"RobinEggBlue");
- public static readonly Color Rose = new Color(1,0,0.498039215686275,1.0,"Rose");
- public static readonly Color RoseBonbon = new Color(0.976470588235294,0.258823529411765,0.619607843137255,1.0,"RoseBonbon");
- public static readonly Color RoseEbony = new Color(0.403921568627451,0.282352941176471,0.274509803921569,1.0,"RoseEbony");
- public static readonly Color RoseGold = new Color(0.717647058823529,0.431372549019608,0.474509803921569,1.0,"RoseGold");
- public static readonly Color RoseMadder = new Color(0.890196078431373,0.149019607843137,0.211764705882353,1.0,"RoseMadder");
- public static readonly Color RosePink = new Color(1,0.4,0.8,1.0,"RosePink");
- public static readonly Color RoseQuartz = new Color(0.666666666666667,0.596078431372549,0.662745098039216,1.0,"RoseQuartz");
- public static readonly Color RoseTaupe = new Color(0.564705882352941,0.364705882352941,0.364705882352941,1.0,"RoseTaupe");
- public static readonly Color RoseVale = new Color(0.670588235294118,0.305882352941176,0.32156862745098,1.0,"RoseVale");
- public static readonly Color Rosewood = new Color(0.396078431372549,0,0.0431372549019608,1.0,"Rosewood");
- public static readonly Color RossoCorsa = new Color(0.831372549019608,0,0,1.0,"RossoCorsa");
- public static readonly Color RosyBrown = new Color(0.737254901960784,0.56078431372549,0.56078431372549,1.0,"RosyBrown");
- public static readonly Color RoyalAzure = new Color(0,0.219607843137255,0.658823529411765,1.0,"RoyalAzure");
- public static readonly Color RoyalBlueTraditional = new Color(0,0.137254901960784,0.4,1.0,"RoyalBlueTraditional");
- public static readonly Color RoyalBlueWeb = new Color(0.254901960784314,0.411764705882353,0.882352941176471,1.0,"RoyalBlueWeb");
- public static readonly Color RoyalFuchsia = new Color(0.792156862745098,0.172549019607843,0.572549019607843,1.0,"RoyalFuchsia");
- public static readonly Color RoyalPurple = new Color(0.470588235294118,0.317647058823529,0.662745098039216,1.0,"RoyalPurple");
- public static readonly Color RoyalYellow = new Color(0.980392156862745,0.854901960784314,0.368627450980392,1.0,"RoyalYellow");
- public static readonly Color RubineRed = new Color(0.819607843137255,0,0.337254901960784,1.0,"RubineRed");
- public static readonly Color Ruby = new Color(0.87843137254902,0.0666666666666667,0.372549019607843,1.0,"Ruby");
- public static readonly Color RubyRed = new Color(0.607843137254902,0.0666666666666667,0.117647058823529,1.0,"RubyRed");
- public static readonly Color Ruddy = new Color(1,0,0.156862745098039,1.0,"Ruddy");
- public static readonly Color RuddyBrown = new Color(0.733333333333333,0.396078431372549,0.156862745098039,1.0,"RuddyBrown");
- public static readonly Color RuddyPink = new Color(0.882352941176471,0.556862745098039,0.588235294117647,1.0,"RuddyPink");
- public static readonly Color Rufous = new Color(0.658823529411765,0.109803921568627,0.0274509803921569,1.0,"Rufous");
- public static readonly Color Russet = new Color(0.501960784313725,0.274509803921569,0.105882352941176,1.0,"Russet");
- public static readonly Color Rust = new Color(0.717647058823529,0.254901960784314,0.0549019607843137,1.0,"Rust");
- public static readonly Color RustyRed = new Color(0.854901960784314,0.172549019607843,0.262745098039216,1.0,"RustyRed");
- public static readonly Color SacramentoStateGreen = new Color(0,0.337254901960784,0.247058823529412,1.0,"SacramentoStateGreen");
- public static readonly Color SaddleBrown = new Color(0.545098039215686,0.270588235294118,0.0745098039215686,1.0,"SaddleBrown");
- public static readonly Color SafetyOrangeBlazeOrange = new Color(1,0.403921568627451,0,1.0,"SafetyOrangeBlazeOrange");
- public static readonly Color Saffron = new Color(0.956862745098039,0.768627450980392,0.188235294117647,1.0,"Saffron");
- public static readonly Color Salmon = new Color(1,0.549019607843137,0.411764705882353,1.0,"Salmon");
- public static readonly Color SalmonPink = new Color(1,0.568627450980392,0.643137254901961,1.0,"SalmonPink");
- public static readonly Color Sand = new Color(0.76078431372549,0.698039215686274,0.501960784313725,1.0,"Sand");
- public static readonly Color SandDune = new Color(0.588235294117647,0.443137254901961,0.0901960784313725,1.0,"SandDune");
- public static readonly Color Sandstorm = new Color(0.925490196078431,0.835294117647059,0.250980392156863,1.0,"Sandstorm");
- public static readonly Color SandyBrown = new Color(0.956862745098039,0.643137254901961,0.376470588235294,1.0,"SandyBrown");
- public static readonly Color SandyTaupe = new Color(0.588235294117647,0.443137254901961,0.0901960784313725,1.0,"SandyTaupe");
- public static readonly Color Sangria = new Color(0.572549019607843,0,0.0392156862745098,1.0,"Sangria");
- public static readonly Color SapGreen = new Color(0.313725490196078,0.490196078431373,0.164705882352941,1.0,"SapGreen");
- public static readonly Color Sapphire = new Color(0.0588235294117647,0.32156862745098,0.729411764705882,1.0,"Sapphire");
- public static readonly Color SapphireBlue = new Color(0,0.403921568627451,0.647058823529412,1.0,"SapphireBlue");
- public static readonly Color SatinSheenGold = new Color(0.796078431372549,0.631372549019608,0.207843137254902,1.0,"SatinSheenGold");
- public static readonly Color Scarlet = new Color(1,0.141176470588235,0,1.0,"Scarlet");
- public static readonly Color ScarletCrayola = new Color(0.992156862745098,0.0549019607843137,0.207843137254902,1.0,"ScarletCrayola");
- public static readonly Color SchoolBusYellow = new Color(1,0.847058823529412,0,1.0,"SchoolBusYellow");
- public static readonly Color ScreaminGreen = new Color(0.462745098039216,1,0.47843137254902,1.0,"ScreaminGreen");
- public static readonly Color SeaBlue = new Color(0,0.411764705882353,0.580392156862745,1.0,"SeaBlue");
- public static readonly Color SeaGreen = new Color(0.180392156862745,0.545098039215686,0.341176470588235,1.0,"SeaGreen");
- public static readonly Color SealBrown = new Color(0.196078431372549,0.0784313725490196,0.0784313725490196,1.0,"SealBrown");
- public static readonly Color Seashell = new Color(1,0.96078431372549,0.933333333333333,1.0,"Seashell");
- public static readonly Color SelectiveYellow = new Color(1,0.729411764705882,0,1.0,"SelectiveYellow");
- public static readonly Color Sepia = new Color(0.43921568627451,0.258823529411765,0.0784313725490196,1.0,"Sepia");
- public static readonly Color Shadow = new Color(0.541176470588235,0.474509803921569,0.364705882352941,1.0,"Shadow");
- public static readonly Color ShamrockGreen = new Color(0,0.619607843137255,0.376470588235294,1.0,"ShamrockGreen");
- public static readonly Color ShockingPink = new Color(0.988235294117647,0.0588235294117647,0.752941176470588,1.0,"ShockingPink");
- public static readonly Color ShockingPinkCrayola = new Color(1,0.435294117647059,1,1.0,"ShockingPinkCrayola");
- public static readonly Color Sienna = new Color(0.533333333333333,0.176470588235294,0.0901960784313725,1.0,"Sienna");
- public static readonly Color Silver = new Color(0.752941176470588,0.752941176470588,0.752941176470588,1.0,"Silver");
- public static readonly Color Sinopia = new Color(0.796078431372549,0.254901960784314,0.0431372549019608,1.0,"Sinopia");
- public static readonly Color Skobeloff = new Color(0,0.454901960784314,0.454901960784314,1.0,"Skobeloff");
- public static readonly Color SkyBlue = new Color(0.529411764705882,0.807843137254902,0.92156862745098,1.0,"SkyBlue");
- public static readonly Color SkyMagenta = new Color(0.811764705882353,0.443137254901961,0.686274509803922,1.0,"SkyMagenta");
- public static readonly Color SlateBlue = new Color(0.415686274509804,0.352941176470588,0.803921568627451,1.0,"SlateBlue");
- public static readonly Color SlateGray = new Color(0.43921568627451,0.501960784313725,0.564705882352941,1.0,"SlateGray");
- public static readonly Color SmaltDarkPowderBlue = new Color(0,0.2,0.6,1.0,"SmaltDarkPowderBlue");
- public static readonly Color SmokeyTopaz = new Color(0.576470588235294,0.23921568627451,0.254901960784314,1.0,"SmokeyTopaz");
- public static readonly Color SmokyBlack = new Color(0.0627450980392157,0.0470588235294118,0.0313725490196078,1.0,"SmokyBlack");
- public static readonly Color Snow = new Color(1,0.980392156862745,0.980392156862745,1.0,"Snow");
- public static readonly Color SpiroDiscoBall = new Color(0.0588235294117647,0.752941176470588,0.988235294117647,1.0,"SpiroDiscoBall");
- public static readonly Color SpringBud = new Color(0.654901960784314,0.988235294117647,0,1.0,"SpringBud");
- public static readonly Color SpringGreen = new Color(0,1,0.498039215686275,1.0,"SpringGreen");
- public static readonly Color StPatrickSBlue = new Color(0.137254901960784,0.16078431372549,0.47843137254902,1.0,"StPatrickSBlue");
- public static readonly Color SteelBlue = new Color(0.274509803921569,0.509803921568627,0.705882352941177,1.0,"SteelBlue");
- public static readonly Color StilDeGrainYellow = new Color(0.980392156862745,0.854901960784314,0.368627450980392,1.0,"StilDeGrainYellow");
- public static readonly Color Stizza = new Color(0.6,0,0,1.0,"Stizza");
- public static readonly Color Stormcloud = new Color(0.309803921568627,0.4,0.415686274509804,1.0,"Stormcloud");
- public static readonly Color Straw = new Color(0.894117647058824,0.850980392156863,0.435294117647059,1.0,"Straw");
- public static readonly Color Sunglow = new Color(1,0.8,0.2,1.0,"Sunglow");
- public static readonly Color Sunset = new Color(0.980392156862745,0.83921568627451,0.647058823529412,1.0,"Sunset");
- public static readonly Color Tan = new Color(0.823529411764706,0.705882352941177,0.549019607843137,1.0,"Tan");
- public static readonly Color Tangelo = new Color(0.976470588235294,0.301960784313725,0,1.0,"Tangelo");
- public static readonly Color Tangerine = new Color(0.949019607843137,0.52156862745098,0,1.0,"Tangerine");
- public static readonly Color TangerineYellow = new Color(1,0.8,0,1.0,"TangerineYellow");
- public static readonly Color TangoPink = new Color(0.894117647058824,0.443137254901961,0.47843137254902,1.0,"TangoPink");
- public static readonly Color Taupe = new Color(0.282352941176471,0.235294117647059,0.196078431372549,1.0,"Taupe");
- public static readonly Color TaupeGray = new Color(0.545098039215686,0.52156862745098,0.537254901960784,1.0,"TaupeGray");
- public static readonly Color TeaGreen = new Color(0.815686274509804,0.941176470588235,0.752941176470588,1.0,"TeaGreen");
- public static readonly Color TeaRoseOrange = new Color(0.972549019607843,0.513725490196078,0.474509803921569,1.0,"TeaRoseOrange");
- public static readonly Color TeaRoseRose = new Color(0.956862745098039,0.76078431372549,0.76078431372549,1.0,"TeaRoseRose");
- public static readonly Color Teal = new Color(0,0.501960784313725,0.501960784313725,1.0,"Teal");
- public static readonly Color TealBlue = new Color(0.211764705882353,0.458823529411765,0.533333333333333,1.0,"TealBlue");
- public static readonly Color TealGreen = new Color(0,0.509803921568627,0.498039215686275,1.0,"TealGreen");
- public static readonly Color Telemagenta = new Color(0.811764705882353,0.203921568627451,0.462745098039216,1.0,"Telemagenta");
- public static readonly Color TennTawny = new Color(0.803921568627451,0.341176470588235,0,1.0,"TennTawny");
- public static readonly Color TerraCotta = new Color(0.886274509803922,0.447058823529412,0.356862745098039,1.0,"TerraCotta");
- public static readonly Color Thistle = new Color(0.847058823529412,0.749019607843137,0.847058823529412,1.0,"Thistle");
- public static readonly Color ThulianPink = new Color(0.870588235294118,0.435294117647059,0.631372549019608,1.0,"ThulianPink");
- public static readonly Color TickleMePink = new Color(0.988235294117647,0.537254901960784,0.674509803921569,1.0,"TickleMePink");
- public static readonly Color TiffanyBlue = new Color(0.0392156862745098,0.729411764705882,0.709803921568627,1.0,"TiffanyBlue");
- public static readonly Color TigerSEye = new Color(0.87843137254902,0.552941176470588,0.235294117647059,1.0,"TigerSEye");
- public static readonly Color Timberwolf = new Color(0.858823529411765,0.843137254901961,0.823529411764706,1.0,"Timberwolf");
- public static readonly Color TitaniumYellow = new Color(0.933333333333333,0.901960784313726,0,1.0,"TitaniumYellow");
- public static readonly Color Tomato = new Color(1,0.388235294117647,0.27843137254902,1.0,"Tomato");
- public static readonly Color Toolbox = new Color(0.454901960784314,0.423529411764706,0.752941176470588,1.0,"Toolbox");
- public static readonly Color Topaz = new Color(1,0.784313725490196,0.486274509803922,1.0,"Topaz");
- public static readonly Color TractorRed = new Color(0.992156862745098,0.0549019607843137,0.207843137254902,1.0,"TractorRed");
- public static readonly Color TrolleyGrey = new Color(0.501960784313725,0.501960784313725,0.501960784313725,1.0,"TrolleyGrey");
- public static readonly Color TropicalRainForest = new Color(0,0.458823529411765,0.368627450980392,1.0,"TropicalRainForest");
- public static readonly Color TrueBlue = new Color(0,0.450980392156863,0.811764705882353,1.0,"TrueBlue");
- public static readonly Color TuftsBlue = new Color(0.254901960784314,0.490196078431373,0.756862745098039,1.0,"TuftsBlue");
- public static readonly Color Tumbleweed = new Color(0.870588235294118,0.666666666666667,0.533333333333333,1.0,"Tumbleweed");
- public static readonly Color TurkishRose = new Color(0.709803921568627,0.447058823529412,0.505882352941176,1.0,"TurkishRose");
- public static readonly Color Turquoise = new Color(0.188235294117647,0.835294117647059,0.784313725490196,1.0,"Turquoise");
- public static readonly Color TurquoiseBlue = new Color(0,1,0.937254901960784,1.0,"TurquoiseBlue");
- public static readonly Color TurquoiseGreen = new Color(0.627450980392157,0.83921568627451,0.705882352941177,1.0,"TurquoiseGreen");
- public static readonly Color TuscanRed = new Color(0.486274509803922,0.282352941176471,0.282352941176471,1.0,"TuscanRed");
- public static readonly Color TwilightLavender = new Color(0.541176470588235,0.286274509803922,0.419607843137255,1.0,"TwilightLavender");
- public static readonly Color TyrianPurple = new Color(0.4,0.00784313725490196,0.235294117647059,1.0,"TyrianPurple");
- public static readonly Color UaBlue = new Color(0,0.2,0.666666666666667,1.0,"UaBlue");
- public static readonly Color UaRed = new Color(0.850980392156863,0,0.298039215686275,1.0,"UaRed");
- public static readonly Color Ube = new Color(0.533333333333333,0.470588235294118,0.764705882352941,1.0,"Ube");
- public static readonly Color UclaBlue = new Color(0.325490196078431,0.407843137254902,0.584313725490196,1.0,"UclaBlue");
- public static readonly Color UclaGold = new Color(1,0.701960784313725,0,1.0,"UclaGold");
- public static readonly Color UfoGreen = new Color(0.235294117647059,0.815686274509804,0.43921568627451,1.0,"UfoGreen");
- public static readonly Color UltraPink = new Color(1,0.435294117647059,1,1.0,"UltraPink");
- public static readonly Color Ultramarine = new Color(0.0705882352941176,0.0392156862745098,0.56078431372549,1.0,"Ultramarine");
- public static readonly Color UltramarineBlue = new Color(0.254901960784314,0.4,0.96078431372549,1.0,"UltramarineBlue");
- public static readonly Color Umber = new Color(0.388235294117647,0.317647058823529,0.27843137254902,1.0,"Umber");
- public static readonly Color UnbleachedSilk = new Color(1,0.866666666666667,0.792156862745098,1.0,"UnbleachedSilk");
- public static readonly Color UnitedNationsBlue = new Color(0.356862745098039,0.572549019607843,0.898039215686275,1.0,"UnitedNationsBlue");
- public static readonly Color UniversityOfCaliforniaGold = new Color(0.717647058823529,0.529411764705882,0.152941176470588,1.0,"UniversityOfCaliforniaGold");
- public static readonly Color UnmellowYellow = new Color(1,1,0.4,1.0,"UnmellowYellow");
- public static readonly Color UpForestGreen = new Color(0.00392156862745098,0.266666666666667,0.129411764705882,1.0,"UpForestGreen");
- public static readonly Color UpMaroon = new Color(0.482352941176471,0.0666666666666667,0.0745098039215686,1.0,"UpMaroon");
- public static readonly Color UpsdellRed = new Color(0.682352941176471,0.125490196078431,0.16078431372549,1.0,"UpsdellRed");
- public static readonly Color Urobilin = new Color(0.882352941176471,0.67843137254902,0.129411764705882,1.0,"Urobilin");
- public static readonly Color UsafaBlue = new Color(0,0.309803921568627,0.596078431372549,1.0,"UsafaBlue");
- public static readonly Color UscCardinal = new Color(0.6,0,0,1.0,"UscCardinal");
- public static readonly Color UscGold = new Color(1,0.8,0,1.0,"UscGold");
- public static readonly Color UtahCrimson = new Color(0.827450980392157,0,0.247058823529412,1.0,"UtahCrimson");
- public static readonly Color Vanilla = new Color(0.952941176470588,0.898039215686275,0.670588235294118,1.0,"Vanilla");
- public static readonly Color VegasGold = new Color(0.772549019607843,0.701960784313725,0.345098039215686,1.0,"VegasGold");
- public static readonly Color VenetianRed = new Color(0.784313725490196,0.0313725490196078,0.0823529411764706,1.0,"VenetianRed");
- public static readonly Color Verdigris = new Color(0.262745098039216,0.701960784313725,0.682352941176471,1.0,"Verdigris");
- public static readonly Color VermilionCinnabar = new Color(0.890196078431373,0.258823529411765,0.203921568627451,1.0,"VermilionCinnabar");
- public static readonly Color VermilionPlochere = new Color(0.850980392156863,0.376470588235294,0.231372549019608,1.0,"VermilionPlochere");
- public static readonly Color Veronica = new Color(0.627450980392157,0.125490196078431,0.941176470588235,1.0,"Veronica");
- public static readonly Color Violet = new Color(0.56078431372549,0,1,1.0,"Violet");
- public static readonly Color VioletBlue = new Color(0.196078431372549,0.290196078431373,0.698039215686274,1.0,"VioletBlue");
- public static readonly Color VioletColorWheel = new Color(0.498039215686275,0,1,1.0,"VioletColorWheel");
- public static readonly Color VioletRyb = new Color(0.525490196078431,0.00392156862745098,0.686274509803922,1.0,"VioletRyb");
- public static readonly Color VioletWeb = new Color(0.933333333333333,0.509803921568627,0.933333333333333,1.0,"VioletWeb");
- public static readonly Color Viridian = new Color(0.250980392156863,0.509803921568627,0.427450980392157,1.0,"Viridian");
- public static readonly Color VividAuburn = new Color(0.572549019607843,0.152941176470588,0.141176470588235,1.0,"VividAuburn");
- public static readonly Color VividBurgundy = new Color(0.623529411764706,0.113725490196078,0.207843137254902,1.0,"VividBurgundy");
- public static readonly Color VividCerise = new Color(0.854901960784314,0.113725490196078,0.505882352941176,1.0,"VividCerise");
- public static readonly Color VividTangerine = new Color(1,0.627450980392157,0.537254901960784,1.0,"VividTangerine");
- public static readonly Color VividViolet = new Color(0.623529411764706,0,1,1.0,"VividViolet");
- public static readonly Color WarmBlack = new Color(0,0.258823529411765,0.258823529411765,1.0,"WarmBlack");
- public static readonly Color Waterspout = new Color(0.643137254901961,0.956862745098039,0.976470588235294,1.0,"Waterspout");
- public static readonly Color Wenge = new Color(0.392156862745098,0.329411764705882,0.32156862745098,1.0,"Wenge");
- public static readonly Color Wheat = new Color(0.96078431372549,0.870588235294118,0.701960784313725,1.0,"Wheat");
- public static readonly Color White = new Color(1,1,1,1.0,"White");
- public static readonly Color WhiteSmoke = new Color(0.96078431372549,0.96078431372549,0.96078431372549,1.0,"WhiteSmoke");
- public static readonly Color WildBlueYonder = new Color(0.635294117647059,0.67843137254902,0.815686274509804,1.0,"WildBlueYonder");
- public static readonly Color WildStrawberry = new Color(1,0.262745098039216,0.643137254901961,1.0,"WildStrawberry");
- public static readonly Color WildWatermelon = new Color(0.988235294117647,0.423529411764706,0.52156862745098,1.0,"WildWatermelon");
- public static readonly Color Wine = new Color(0.447058823529412,0.184313725490196,0.215686274509804,1.0,"Wine");
- public static readonly Color WineDregs = new Color(0.403921568627451,0.192156862745098,0.27843137254902,1.0,"WineDregs");
- public static readonly Color Wisteria = new Color(0.788235294117647,0.627450980392157,0.862745098039216,1.0,"Wisteria");
- public static readonly Color WoodBrown = new Color(0.756862745098039,0.603921568627451,0.419607843137255,1.0,"WoodBrown");
- public static readonly Color Xanadu = new Color(0.450980392156863,0.525490196078431,0.470588235294118,1.0,"Xanadu");
- public static readonly Color YaleBlue = new Color(0.0588235294117647,0.301960784313725,0.572549019607843,1.0,"YaleBlue");
- public static readonly Color Yellow = new Color(1,1,0,1.0,"Yellow");
- public static readonly Color YellowGreen = new Color(0.603921568627451,0.803921568627451,0.196078431372549,1.0,"YellowGreen");
- public static readonly Color YellowMunsell = new Color(0.937254901960784,0.8,0,1.0,"YellowMunsell");
- public static readonly Color YellowNcs = new Color(1,0.827450980392157,0,1.0,"YellowNcs");
- public static readonly Color YellowOrange = new Color(1,0.682352941176471,0.258823529411765,1.0,"YellowOrange");
- public static readonly Color YellowProcess = new Color(1,0.937254901960784,0,1.0,"YellowProcess");
- public static readonly Color YellowRyb = new Color(0.996078431372549,0.996078431372549,0.2,1.0,"YellowRyb");
- public static readonly Color Zaffre = new Color(0,0.0784313725490196,0.658823529411765,1.0,"Zaffre");
- public static readonly Color ZinnwalditeBrown = new Color(0.172549019607843,0.0862745098039216,0.0313725490196078,1.0,"ZinnwalditeBrown");
- #endregion
+ public static readonly Color AliceBlue = new Color(240,248,255,"AliceBlue","#F0F8FF");
+ public static readonly Color AntiqueWhite = new Color(250,235,215,"AntiqueWhite","#FAEBD7");
+ public static readonly Color Aqua = new Color(0,255,255,"Aqua","#00FFFF");
+ public static readonly Color Aquamarine = new Color(127,255,212,"Aquamarine","#7FFFD4");
+ public static readonly Color Azure = new Color(240,255,255,"Azure","#F0FFFF");
+ public static readonly Color Beige = new Color(245,245,220,"Beige","#F5F5DC");
+ public static readonly Color Bisque = new Color(255,228,196,"Bisque","#FFE4C4");
+ public static readonly Color Black = new Color(0,0,0,"Black","#000000");
+ public static readonly Color BlanchedAlmond = new Color(255,235,205,"BlanchedAlmond","#FFEBCD");
+ public static readonly Color Blue = new Color(0,0,255,"Blue","#0000FF");
+ public static readonly Color BlueViolet = new Color(138,43,226,"BlueViolet","#8A2BE2");
+ public static readonly Color Brown = new Color(165,42,42,"Brown","#A52A2A");
+ public static readonly Color BurlyWood = new Color(222,184,135,"BurlyWood","#DEB887");
+ public static readonly Color CadetBlue = new Color(95,158,160,"CadetBlue","#5F9EA0");
+ public static readonly Color Chartreuse = new Color(127,255,0,"Chartreuse","#7FFF00");
+ public static readonly Color Chocolate = new Color(210,105,30,"Chocolate","#D2691E");
+ public static readonly Color Coral = new Color(255,127,80,"Coral","#FF7F50");
+ public static readonly Color CornflowerBlue = new Color(100,149,237,"CornflowerBlue","#6495ED");
+ public static readonly Color Cornsilk = new Color(255,248,220,"Cornsilk","#FFF8DC");
+ public static readonly Color Crimson = new Color(220,20,60,"Crimson","#DC143C");
+ public static readonly Color Cyan = new Color(0,255,255,"Cyan","#00FFFF");
+ public static readonly Color DarkBlue = new Color(0,0,139,"DarkBlue","#00008B");
+ public static readonly Color DarkCyan = new Color(0,139,139,"DarkCyan","#008B8B");
+ public static readonly Color DarkGoldenRod = new Color(184,134,11,"DarkGoldenRod","#B8860B");
+ public static readonly Color DarkGray = new Color(169,169,169,"DarkGray","#A9A9A9");
+ public static readonly Color DarkGrey = new Color(169,169,169,"DarkGrey","#A9A9A9");
+ public static readonly Color DarkGreen = new Color(0,100,0,"DarkGreen","#006400");
+ public static readonly Color DarkKhaki = new Color(189,183,107,"DarkKhaki","#BDB76B");
+ public static readonly Color DarkMagenta = new Color(139,0,139,"DarkMagenta","#8B008B");
+ public static readonly Color DarkOliveGreen = new Color(85,107,47,"DarkOliveGreen","#556B2F");
+ public static readonly Color DarkOrange = new Color(255,140,0,"DarkOrange","#FF8C00");
+ public static readonly Color DarkOrchid = new Color(153,50,204,"DarkOrchid","#9932CC");
+ public static readonly Color DarkRed = new Color(139,0,0,"DarkRed","#8B0000");
+ public static readonly Color DarkSalmon = new Color(233,150,122,"DarkSalmon","#E9967A");
+ public static readonly Color DarkSeaGreen = new Color(143,188,143,"DarkSeaGreen","#8FBC8F");
+ public static readonly Color DarkSlateBlue = new Color(72,61,139,"DarkSlateBlue","#483D8B");
+ public static readonly Color DarkSlateGray = new Color(47,79,79,"DarkSlateGray","#2F4F4F");
+ public static readonly Color DarkSlateGrey = new Color(47,79,79,"DarkSlateGrey","#2F4F4F");
+ public static readonly Color DarkTurquoise = new Color(0,206,209,"DarkTurquoise","#00CED1");
+ public static readonly Color DarkViolet = new Color(148,0,211,"DarkViolet","#9400D3");
+ public static readonly Color DeepPink = new Color(255,20,147,"DeepPink","#FF1493");
+ public static readonly Color DeepSkyBlue = new Color(0,191,255,"DeepSkyBlue","#00BFFF");
+ public static readonly Color DimGray = new Color(105,105,105,"DimGray","#696969");
+ public static readonly Color DimGrey = new Color(105,105,105,"DimGrey","#696969");
+ public static readonly Color DodgerBlue = new Color(30,144,255,"DodgerBlue","#1E90FF");
+ public static readonly Color FireBrick = new Color(178,34,34,"FireBrick","#B22222");
+ public static readonly Color FloralWhite = new Color(255,250,240,"FloralWhite","#FFFAF0");
+ public static readonly Color ForestGreen = new Color(34,139,34,"ForestGreen","#228B22");
+ public static readonly Color Fuchsia = new Color(255,0,255,"Fuchsia","#FF00FF");
+ public static readonly Color Gainsboro = new Color(220,220,220,"Gainsboro","#DCDCDC");
+ public static readonly Color GhostWhite = new Color(248,248,255,"GhostWhite","#F8F8FF");
+ public static readonly Color Gold = new Color(255,215,0,"Gold","#FFD700");
+ public static readonly Color GoldenRod = new Color(218,165,32,"GoldenRod","#DAA520");
+ public static readonly Color Gray = new Color(128,128,128,"Gray","#808080");
+ public static readonly Color Grey = new Color(128,128,128,"Grey","#808080");
+ public static readonly Color Green = new Color(0,128,0,"Green","#008000");
+ public static readonly Color GreenYellow = new Color(173,255,47,"GreenYellow","#ADFF2F");
+ public static readonly Color HoneyDew = new Color(240,255,240,"HoneyDew","#F0FFF0");
+ public static readonly Color HotPink = new Color(255,105,180,"HotPink","#FF69B4");
+ public static readonly Color IndianRed = new Color(205,92,92,"IndianRed","#CD5C5C");
+ public static readonly Color Indigo = new Color(75,0,130,"Indigo","#4B0082");
+ public static readonly Color Ivory = new Color(255,255,240,"Ivory","#FFFFF0");
+ public static readonly Color Jet = new Color(52,52,52,"Jet","#343434");
+ public static readonly Color Khaki = new Color(240,230,140,"Khaki","#F0E68C");
+ public static readonly Color Lavender = new Color(230,230,250,"Lavender","#E6E6FA");
+ public static readonly Color LavenderBlush = new Color(255,240,245,"LavenderBlush","#FFF0F5");
+ public static readonly Color LawnGreen = new Color(124,252,0,"LawnGreen","#7CFC00");
+ public static readonly Color LemonChiffon = new Color(255,250,205,"LemonChiffon","#FFFACD");
+ public static readonly Color LightBlue = new Color(173,216,230,"LightBlue","#ADD8E6");
+ public static readonly Color LightCoral = new Color(240,128,128,"LightCoral","#F08080");
+ public static readonly Color LightCyan = new Color(224,255,255,"LightCyan","#E0FFFF");
+ public static readonly Color LightGoldenRodYellow = new Color(250,250,210,"LightGoldenRodYellow","#FAFAD2");
+ public static readonly Color LightGray = new Color(211,211,211,"LightGray","#D3D3D3");
+ public static readonly Color LightGrey = new Color(211,211,211,"LightGrey","#D3D3D3");
+ public static readonly Color LightGreen = new Color(144,238,144,"LightGreen","#90EE90");
+ public static readonly Color LightPink = new Color(255,182,193,"LightPink","#FFB6C1");
+ public static readonly Color LightSalmon = new Color(255,160,122,"LightSalmon","#FFA07A");
+ public static readonly Color LightSeaGreen = new Color(32,178,170,"LightSeaGreen","#20B2AA");
+ public static readonly Color LightSkyBlue = new Color(135,206,250,"LightSkyBlue","#87CEFA");
+ public static readonly Color LightSlateGray = new Color(119,136,153,"LightSlateGray","#778899");
+ public static readonly Color LightSlateGrey = new Color(119,136,153,"LightSlateGrey","#778899");
+ public static readonly Color LightSteelBlue = new Color(176,196,222,"LightSteelBlue","#B0C4DE");
+ public static readonly Color LightYellow = new Color(255,255,224,"LightYellow","#FFFFE0");
+ public static readonly Color Lime = new Color(0,255,0,"Lime","#00FF00");
+ public static readonly Color LimeGreen = new Color(50,205,50,"LimeGreen","#32CD32");
+ public static readonly Color Linen = new Color(250,240,230,"Linen","#FAF0E6");
+ public static readonly Color Magenta = new Color(255,0,255,"Magenta","#FF00FF");
+ public static readonly Color Maroon = new Color(128,0,0,"Maroon","#800000");
+ public static readonly Color MediumAquaMarine = new Color(102,205,170,"MediumAquaMarine","#66CDAA");
+ public static readonly Color MediumBlue = new Color(0,0,205,"MediumBlue","#0000CD");
+ public static readonly Color MediumOrchid = new Color(186,85,211,"MediumOrchid","#BA55D3");
+ public static readonly Color MediumPurple = new Color(147,112,219,"MediumPurple","#9370DB");
+ public static readonly Color MediumSeaGreen = new Color(60,179,113,"MediumSeaGreen","#3CB371");
+ public static readonly Color MediumSlateBlue = new Color(123,104,238,"MediumSlateBlue","#7B68EE");
+ public static readonly Color MediumSpringGreen = new Color(0,250,154,"MediumSpringGreen","#00FA9A");
+ public static readonly Color MediumTurquoise = new Color(72,209,204,"MediumTurquoise","#48D1CC");
+ public static readonly Color MediumVioletRed = new Color(199,21,133,"MediumVioletRed","#C71585");
+ public static readonly Color MidnightBlue = new Color(25,25,112,"MidnightBlue","#191970");
+ public static readonly Color MintCream = new Color(245,255,250,"MintCream","#F5FFFA");
+ public static readonly Color MistyRose = new Color(255,228,225,"MistyRose","#FFE4E1");
+ public static readonly Color Moccasin = new Color(255,228,181,"Moccasin","#FFE4B5");
+ public static readonly Color NavajoWhite = new Color(255,222,173,"NavajoWhite","#FFDEAD");
+ public static readonly Color Navy = new Color(0,0,128,"Navy","#000080");
+ public static readonly Color OldLace = new Color(253,245,230,"OldLace","#FDF5E6");
+ public static readonly Color Olive = new Color(128,128,0,"Olive","#808000");
+ public static readonly Color OliveDrab = new Color(107,142,35,"OliveDrab","#6B8E23");
+ public static readonly Color Onyx = new Color(53,56,57,"Onyx","#353839");
+ public static readonly Color Orange = new Color(255,165,0,"Orange","#FFA500");
+ public static readonly Color OrangeRed = new Color(255,69,0,"OrangeRed","#FF4500");
+ public static readonly Color Orchid = new Color(218,112,214,"Orchid","#DA70D6");
+ public static readonly Color PaleGoldenRod = new Color(238,232,170,"PaleGoldenRod","#EEE8AA");
+ public static readonly Color PaleGreen = new Color(152,251,152,"PaleGreen","#98FB98");
+ public static readonly Color PaleTurquoise = new Color(175,238,238,"PaleTurquoise","#AFEEEE");
+ public static readonly Color PaleVioletRed = new Color(219,112,147,"PaleVioletRed","#DB7093");
+ public static readonly Color PapayaWhip = new Color(255,239,213,"PapayaWhip","#FFEFD5");
+ public static readonly Color PeachPuff = new Color(255,218,185,"PeachPuff","#FFDAB9");
+ public static readonly Color Peru = new Color(205,133,63,"Peru","#CD853F");
+ public static readonly Color Pink = new Color(255,192,203,"Pink","#FFC0CB");
+ public static readonly Color Plum = new Color(221,160,221,"Plum","#DDA0DD");
+ public static readonly Color PowderBlue = new Color(176,224,230,"PowderBlue","#B0E0E6");
+ public static readonly Color Purple = new Color(128,0,128,"Purple","#800080");
+ public static readonly Color RebeccaPurple = new Color(102,51,153,"RebeccaPurple","#663399");
+ public static readonly Color Red = new Color(255,0,0,"Red","#FF0000");
+ public static readonly Color RosyBrown = new Color(188,143,143,"RosyBrown","#BC8F8F");
+ public static readonly Color RoyalBlue = new Color(65,105,225,"RoyalBlue","#4169E1");
+ public static readonly Color SaddleBrown = new Color(139,69,19,"SaddleBrown","#8B4513");
+ public static readonly Color Salmon = new Color(250,128,114,"Salmon","#FA8072");
+ public static readonly Color SandyBrown = new Color(244,164,96,"SandyBrown","#F4A460");
+ public static readonly Color SeaGreen = new Color(46,139,87,"SeaGreen","#2E8B57");
+ public static readonly Color SeaShell = new Color(255,245,238,"SeaShell","#FFF5EE");
+ public static readonly Color Sienna = new Color(160,82,45,"Sienna","#A0522D");
+ public static readonly Color Silver = new Color(192,192,192,"Silver","#C0C0C0");
+ public static readonly Color SkyBlue = new Color(135,206,235,"SkyBlue","#87CEEB");
+ public static readonly Color SlateBlue = new Color(106,90,205,"SlateBlue","#6A5ACD");
+ public static readonly Color SlateGray = new Color(112,128,144,"SlateGray","#708090");
+ public static readonly Color SlateGrey = new Color(112,128,144,"SlateGrey","#708090");
+ public static readonly Color Snow = new Color(255,250,250,"Snow","#FFFAFA");
+ public static readonly Color SpringGreen = new Color(0,255,127,"SpringGreen","#00FF7F");
+ public static readonly Color SteelBlue = new Color(70,130,180,"SteelBlue","#4682B4");
+ public static readonly Color Tan = new Color(210,180,140,"Tan","#D2B48C");
+ public static readonly Color Teal = new Color(0,128,128,"Teal","#008080");
+ public static readonly Color Thistle = new Color(216,191,216,"Thistle","#D8BFD8");
+ public static readonly Color Tomato = new Color(255,99,71,"Tomato","#FF6347");
+ public static readonly Color Turquoise = new Color(64,224,208,"Turquoise","#40E0D0");
+ public static readonly Color Violet = new Color(238,130,238,"Violet","#EE82EE");
+ public static readonly Color Wheat = new Color(245,222,179,"Wheat","#F5DEB3");
+ public static readonly Color White = new Color(255,255,255,"White","#FFFFFF");
+ public static readonly Color WhiteSmoke = new Color(245,245,245,"WhiteSmoke","#F5F5F5");
+ public static readonly Color Yellow = new Color(255,255,0,"Yellow","#FFFF00");
+ public static readonly Color YellowGreen = new Color(154,205,50,"YellowGreen","#9ACD32");
- #region IXmlSerializable
- public void ReadXml(System.Xml.XmlReader reader)
- {
- string[] c = reader["Color"].Split(new char[] { ',' });
- R = double.Parse(c[0]);
- G = double.Parse(c[1]);
- B = double.Parse(c[2]);
- A = double.Parse(c[3]);
- }
- public void WriteXml(System.Xml.XmlWriter writer)
- {
- writer.WriteAttributeString("Color", this.ToString());
- }
- public System.Xml.Schema.XmlSchema GetSchema()
- {
- return null;
- }
#endregion
public override int GetHashCode ()
{
if (!string.IsNullOrEmpty(Name))
return Name;
- Color tc = this;
- if (ColorDic.ContainsValue (this))
- return ColorDic.FirstOrDefault (c => c.Value == tc).Key;
-
- return string.Format("{0},{1},{2},{3}", R, G, B, A);
+ if (!string.IsNullOrEmpty (htmlCode))
+ return htmlCode;
+ string hc = HtmlCode;
+ Color pc = ColorDic.Values.FirstOrDefault (c => c.htmlCode == hc);
+ return pc.predefinied ? pc.Name : hc;
}
public static object Parse(string s)