Example #1
0
        IBufferPen IPenContext.ToPen(int?width, int?height)
        {
            var w = width ?? 1;
            var h = height ?? 1;

            return(Factory.newPen(Colours.ToColor(R, G, B, A)));
        }
Example #2
0
        internal static void Initialize()
        {
            if (Factory == null)
            {
                return;
            }
            Default                = Factory.newFillStyle(Gradient.Horizontal, Colours.ToColor(255, 255, 255), Colours.ToColor(224, 224, 224));
            Blue                   = Factory.newFillStyle(Gradient.BackwardDiagonal, Colour.DodgerBlue, Colour.Black);
            Selection              = Factory.newFillStyle(Gradient.ForwardDiagonal, Colour.MidnightBlue, Colour.Blue);
            LightSelection         = Factory.newFillStyle(Gradient.Horizontal, Colour.Khaki, Colour.Orange);
            OrangeSelection        = Factory.newFillStyle(Gradient.Horizontal, Colour.Gold, Colour.Orange);
            Black                  = Factory.newFillStyle(Gradient.Horizontal, Colour.Black, Colour.DimGray);
            WindowFrame            = Factory.newFillStyle(Gradient.Horizontal, Colour.WindowFrame, Colour.Silver);
            Silver                 = Factory.newFillStyle(Gradient.Vertical, Colour.Silver, Colour.White);
            DarkSilver             = Factory.newFillStyle(Gradient.Vertical, Colour.Silver, Colours.ToColor(105, 105, 105));
            ListDarkAlternateStyle = Factory.newFillStyle(Gradient.BackwardDiagonal, Colour.SeaGreen, Colour.Aqua);

            ListAlternateStyle     = Factory.newFillStyle(Gradient.Horizontal, Colour.Azure, Colour.Silver);
            ListDarkAlternateStyle = Factory.newFillStyle(Gradient.Horizontal, Colour.Black, Colour.DimGray);
            DropDownButton         = Factory.newFillStyle(Gradient.Vertical, Colour.Silver, Colour.White);
            CalendarHighlight      = Factory.newFillStyle(Gradient.Horizontal, Colour.Navy, Colour.Blue);
            WhiteWash = Factory.newFillStyle(Gradient.None, Colour.White);
            GridAlternateDefaultCell = Factory.newFillStyle(Gradient.Horizontal, Colour.Black, Colour.Gray);
            GridBackGround           = Factory.newFillStyle(Gradient.ForwardDiagonal, Colour.Brown, Colour.Cyan);
            GridSelection            = Factory.newFillStyle(Gradient.Vertical, Colour.CornflowerBlue, Colour.Aqua);
            GridColumnHeader         = Factory.newFillStyle(Gradient.Vertical, Colour.Black, Colour.Gray);
            GridLastRowHeader        = Factory.newFillStyle(Gradient.Vertical, Colour.CornflowerBlue, Colour.SkyBlue);
            Canvas = Factory.newFillStyle(Gradient.Vertical, Colour.CornflowerBlue, Colour.Aqua);
            Hover  = Factory.newFillStyle(Gradient.Horizontal, Colour.GradientActiveCaption);
        }
Example #3
0
 public RGBA(int value, byte externalAlpha)
 {
     Colours.ToRGBA(value, out int r, out int g, out int b, out int a, externalAlpha);
     R = (byte)r;
     G = (byte)g;
     B = (byte)b;
     A = (byte)a;
 }
Example #4
0
 public RGBA(int value)
 {
     Colours.ToRGBA(value, out int r, out int g, out int b, out int a);
     R = (byte)r;
     G = (byte)g;
     B = (byte)b;
     A = (byte)a;
 }
Example #5
0
            public int GetColor(float position, float size, bool invert = false)
            {
                GetTweenColorsByStops(ref position, ref size, out int c1, out int c2);

                if (invert)
                    return Colours.Blend(c2, c1, position, size);
                return Colours.Blend(c1, c2, position, size);
            }
Example #6
0
            static unsafe void Scan(IScanner src, int y, int w, int* bkg, int dy, int blen, int colorKey, ref int srcX, ref int srcY, ref int maxX, ref int maxY)
            {
                for (int x = 0; x <= w; x++)
                {
                    var i = x + dy;
                    if (i > blen)
                        break;

                    if (bkg[i] == 0 || Colours.RGBEqual(bkg[i], colorKey))
                        continue;
                    Add(src, x, y, bkg[i].Alpha(), ref srcX, ref srcY, ref maxX, ref maxY);
                }
            }
Example #7
0
            static unsafe void Scan(IScanner src, int y, int w, int* bkg, IBufferPen pen, int dy, int blen, int colorKey, ref int srcX, ref int srcY, ref int maxX, ref int maxY)
            {
                for (int x = 0; x <= w; x++)
                {
                    var i = x + dy;
                    if (i > blen)
                        break;

                    if (bkg[i] == Geometry.TransparentColor ||
                        Colours.RGBEqual(bkg[i], colorKey) ||
                        bkg[i] == pen.ReadPixel(x, y, true))
                        continue;
                    Add(src, x, y, bkg[i].Alpha(), ref srcX, ref srcY, ref maxX, ref maxY);
                }
            }
Example #8
0
 public RGBA Blend(IRGBA c2, float e0 = 0)
 {
     return(Colours.Blend(this, c2.Value, e0));
 }
Example #9
0
 public override int GetHashCode()
 {
     return(Colours.ToColor(R, G, B, A));
 }
Example #10
0
 internal static void Reset()
 {
     Empty               = Colours.ToColor(0, 0, 0, 0);
     ActiveBorder        = Colours.ToColor(180, 180, 180, 255);
     ActiveCaption       = Colours.ToColor(209, 180, 153, 255);
     ActiveCaptionText   = Colours.ToColor(0, 0, 0, 255);
     AppWorkspace        = Colours.ToColor(171, 171, 171, 255);
     Control             = Colours.ToColor(240, 240, 240, 255);
     ControlDark         = Colours.ToColor(160, 160, 160, 255);
     ControlDarkDark     = Colours.ToColor(105, 105, 105, 255);
     ControlLight        = Colours.ToColor(227, 227, 227, 255);
     ControlLightLight   = Colours.ToColor(255, 255, 255, 255);
     ControlText         = Colours.ToColor(0, 0, 0, 255);
     Desktop             = Colours.ToColor(0, 0, 0, 255);
     GrayText            = Colours.ToColor(109, 109, 109, 255);
     Highlight           = Colours.ToColor(255, 153, 51, 255);
     HighlightText       = Colours.ToColor(255, 255, 255, 255);
     HotTrack            = Colours.ToColor(204, 102, 0, 255);
     InactiveBorder      = Colours.ToColor(252, 247, 244, 255);
     InactiveCaption     = Colours.ToColor(219, 205, 191, 255);
     InactiveCaptionText = Colours.ToColor(0, 0, 0, 255);
     Info                 = Colours.ToColor(225, 255, 255, 255);
     InfoText             = Colours.ToColor(0, 0, 0, 255);
     Menu                 = Colours.ToColor(240, 240, 240, 255);
     MenuText             = Colours.ToColor(0, 0, 0, 255);
     ScrollBar            = Colours.ToColor(200, 200, 200, 255);
     Window               = Colours.ToColor(255, 255, 255, 255);
     WindowFrame          = Colours.ToColor(100, 100, 100, 255);
     WindowText           = Colours.ToColor(0, 0, 0, 255);
     Transparent          = Colours.ToColor(255, 255, 255, 0);
     AliceBlue            = Colours.ToColor(255, 248, 240, 255);
     AntiqueWhite         = Colours.ToColor(215, 235, 250, 255);
     Aqua                 = Colours.ToColor(255, 255, 0, 255);
     Aquamarine           = Colours.ToColor(212, 255, 127, 255);
     Azure                = Colours.ToColor(255, 255, 240, 255);
     Beige                = Colours.ToColor(220, 245, 245, 255);
     Bisque               = Colours.ToColor(196, 228, 255, 255);
     Black                = Colours.ToColor(0, 0, 0, 255);
     BlanchedAlmond       = Colours.ToColor(205, 235, 255, 255);
     Blue                 = Colours.ToColor(255, 0, 0, 255);
     BlueViolet           = Colours.ToColor(226, 43, 138, 255);
     Brown                = Colours.ToColor(42, 42, 165, 255);
     BurlyWood            = Colours.ToColor(135, 184, 222, 255);
     CadetBlue            = Colours.ToColor(160, 158, 95, 255);
     Chartreuse           = Colours.ToColor(0, 255, 127, 255);
     Chocolate            = Colours.ToColor(30, 105, 210, 255);
     Coral                = Colours.ToColor(80, 127, 255, 255);
     CornflowerBlue       = Colours.ToColor(237, 149, 100, 255);
     Cornsilk             = Colours.ToColor(220, 248, 255, 255);
     Crimson              = Colours.ToColor(60, 20, 220, 255);
     Cyan                 = Colours.ToColor(255, 255, 0, 255);
     DarkBlue             = Colours.ToColor(139, 0, 0, 255);
     DarkCyan             = Colours.ToColor(139, 139, 0, 255);
     DarkGoldenrod        = Colours.ToColor(11, 134, 184, 255);
     DarkGray             = Colours.ToColor(169, 169, 169, 255);
     DarkGreen            = Colours.ToColor(0, 100, 0, 255);
     DarkKhaki            = Colours.ToColor(107, 183, 189, 255);
     DarkMagenta          = Colours.ToColor(139, 0, 139, 255);
     DarkOliveGreen       = Colours.ToColor(47, 107, 85, 255);
     DarkOrange           = Colours.ToColor(0, 140, 255, 255);
     DarkOrchid           = Colours.ToColor(204, 50, 153, 255);
     DarkRed              = Colours.ToColor(0, 0, 139, 255);
     DarkSalmon           = Colours.ToColor(122, 150, 233, 255);
     DarkSeaGreen         = Colours.ToColor(139, 188, 143, 255);
     DarkSlateBlue        = Colours.ToColor(139, 61, 72, 255);
     DarkSlateGray        = Colours.ToColor(79, 79, 47, 255);
     DarkTurquoise        = Colours.ToColor(209, 206, 0, 255);
     DarkViolet           = Colours.ToColor(211, 0, 148, 255);
     DeepPink             = Colours.ToColor(147, 20, 255, 255);
     DeepSkyBlue          = Colours.ToColor(255, 191, 0, 255);
     DimGray              = Colours.ToColor(105, 105, 105, 255);
     DodgerBlue           = Colours.ToColor(255, 144, 30, 255);
     Firebrick            = Colours.ToColor(34, 34, 178, 255);
     FloralWhite          = Colours.ToColor(240, 250, 255, 255);
     ForestGreen          = Colours.ToColor(34, 139, 34, 255);
     Fuchsia              = Colours.ToColor(255, 0, 255, 255);
     Gainsboro            = Colours.ToColor(220, 220, 220, 255);
     GhostWhite           = Colours.ToColor(255, 248, 248, 255);
     Gold                 = Colours.ToColor(0, 215, 255, 255);
     Goldenrod            = Colours.ToColor(32, 165, 218, 255);
     Gray                 = Colours.ToColor(128, 128, 128, 255);
     Green                = Colours.ToColor(0, 128, 0, 255);
     GreenYellow          = Colours.ToColor(47, 255, 173, 255);
     Honeydew             = Colours.ToColor(240, 255, 240, 255);
     HotPink              = Colours.ToColor(180, 105, 255, 255);
     IndianRed            = Colours.ToColor(92, 92, 205, 255);
     Indigo               = Colours.ToColor(130, 0, 75, 255);
     Ivory                = Colours.ToColor(240, 255, 255, 255);
     Khaki                = Colours.ToColor(140, 230, 240, 255);
     Lavender             = Colours.ToColor(250, 230, 230, 255);
     LavenderBlush        = Colours.ToColor(245, 240, 255, 255);
     LawnGreen            = Colours.ToColor(0, 252, 124, 255);
     LemonChiffon         = Colours.ToColor(205, 250, 255, 255);
     LightBlue            = Colours.ToColor(230, 216, 173, 255);
     LightCoral           = Colours.ToColor(128, 128, 240, 255);
     LightCyan            = Colours.ToColor(255, 255, 224, 255);
     LightGoldenrodYellow = Colours.ToColor(210, 250, 250, 255);
     LightGray            = Colours.ToColor(211, 211, 211, 255);
     LightGreen           = Colours.ToColor(144, 238, 144, 255);
     LightPink            = Colours.ToColor(193, 182, 255, 255);
     LightSalmon          = Colours.ToColor(122, 160, 255, 255);
     LightSeaGreen        = Colours.ToColor(170, 178, 32, 255);
     LightSkyBlue         = Colours.ToColor(250, 206, 135, 255);
     LightSlateGray       = Colours.ToColor(153, 136, 119, 255);
     LightSteelBlue       = Colours.ToColor(222, 196, 176, 255);
     LightYellow          = Colours.ToColor(224, 255, 255, 255);
     Lime                 = Colours.ToColor(0, 255, 0, 255);
     LimeGreen            = Colours.ToColor(50, 205, 50, 255);
     Linen                = Colours.ToColor(230, 240, 250, 255);
     Magenta              = Colours.ToColor(255, 0, 255, 255);
     Maroon               = Colours.ToColor(0, 0, 128, 255);
     MediumAquamarine     = Colours.ToColor(170, 205, 102, 255);
     MediumBlue           = Colours.ToColor(205, 0, 0, 255);
     MediumOrchid         = Colours.ToColor(211, 85, 186, 255);
     MediumPurple         = Colours.ToColor(219, 112, 147, 255);
     MediumSeaGreen       = Colours.ToColor(113, 179, 60, 255);
     MediumSlateBlue      = Colours.ToColor(238, 104, 123, 255);
     MediumSpringGreen    = Colours.ToColor(154, 250, 0, 255);
     MediumTurquoise      = Colours.ToColor(204, 209, 72, 255);
     MediumVioletRed      = Colours.ToColor(133, 21, 199, 255);
     MidnightBlue         = Colours.ToColor(112, 25, 25, 255);
     MintCream            = Colours.ToColor(250, 255, 245, 255);
     MistyRose            = Colours.ToColor(225, 228, 255, 255);
     Moccasin             = Colours.ToColor(181, 228, 255, 255);
     NavajoWhite          = Colours.ToColor(173, 222, 255, 255);
     Navy                 = Colours.ToColor(128, 0, 0, 255);
     OldLace              = Colours.ToColor(230, 245, 253, 255);
     Olive                = Colours.ToColor(0, 128, 128, 255);
     OliveDrab            = Colours.ToColor(35, 142, 107, 255);
     Orange               = Colours.ToColor(0, 165, 255, 255);
     OrangeRed            = Colours.ToColor(0, 69, 255, 255);
     Orchid               = Colours.ToColor(214, 112, 218, 255);
     PaleGoldenrod        = Colours.ToColor(170, 232, 238, 255);
     PaleGreen            = Colours.ToColor(152, 251, 152, 255);
     PaleTurquoise        = Colours.ToColor(238, 238, 175, 255);
     PaleVioletRed        = Colours.ToColor(147, 112, 219, 255);
     PapayaWhip           = Colours.ToColor(213, 239, 255, 255);
     PeachPuff            = Colours.ToColor(185, 218, 255, 255);
     Peru                 = Colours.ToColor(63, 133, 205, 255);
     Pink                 = Colours.ToColor(203, 192, 255, 255);
     Plum                 = Colours.ToColor(221, 160, 221, 255);
     PowderBlue           = Colours.ToColor(230, 224, 176, 255);
     Purple               = Colours.ToColor(128, 0, 128, 255);
     Red                     = Colours.ToColor(0, 0, 255, 255);
     RosyBrown               = Colours.ToColor(143, 143, 188, 255);
     RoyalBlue               = Colours.ToColor(225, 105, 65, 255);
     SaddleBrown             = Colours.ToColor(19, 69, 139, 255);
     Salmon                  = Colours.ToColor(114, 128, 250, 255);
     SandyBrown              = Colours.ToColor(96, 164, 244, 255);
     SeaGreen                = Colours.ToColor(87, 139, 46, 255);
     SeaShell                = Colours.ToColor(238, 245, 255, 255);
     Sienna                  = Colours.ToColor(45, 82, 160, 255);
     Silver                  = Colours.ToColor(192, 192, 192, 255);
     SkyBlue                 = Colours.ToColor(235, 206, 135, 255);
     SlateBlue               = Colours.ToColor(205, 90, 106, 255);
     SlateGray               = Colours.ToColor(144, 128, 112, 255);
     Snow                    = Colours.ToColor(250, 250, 255, 255);
     SpringGreen             = Colours.ToColor(127, 255, 0, 255);
     SteelBlue               = Colours.ToColor(180, 130, 70, 255);
     Tan                     = Colours.ToColor(140, 180, 210, 255);
     Teal                    = Colours.ToColor(128, 128, 0, 255);
     Thistle                 = Colours.ToColor(216, 191, 216, 255);
     Tomato                  = Colours.ToColor(71, 99, 255, 255);
     Turquoise               = Colours.ToColor(208, 224, 64, 255);
     Violet                  = Colours.ToColor(238, 130, 238, 255);
     Wheat                   = Colours.ToColor(179, 222, 245, 255);
     White                   = Colours.ToColor(255, 255, 255, 255);
     WhiteSmoke              = Colours.ToColor(245, 245, 245, 255);
     Yellow                  = Colours.ToColor(0, 255, 255, 255);
     YellowGreen             = Colours.ToColor(50, 205, 154, 255);
     ButtonFace              = Colours.ToColor(240, 240, 240, 255);
     ButtonHighlight         = Colours.ToColor(255, 255, 255, 255);
     ButtonShadow            = Colours.ToColor(160, 160, 160, 255);
     GradientActiveCaption   = Colours.ToColor(234, 209, 185, 255);
     GradientInactiveCaption = Colours.ToColor(242, 228, 215, 255);
     MenuBar                 = Colours.ToColor(240, 240, 240, 255);
     MenuHighlight           = Colours.ToColor(255, 153, 51, 255);
 }