Esempio n. 1
0
        public static XColor ChangeColorBrightness(XColor color, float correctionFactor)
        {
            float red   = (float)color.R;
            float green = (float)color.G;
            float blue  = (float)color.B;

            if (correctionFactor < 0)
            {
                correctionFactor = 1 + correctionFactor;
                red   *= correctionFactor;
                green *= correctionFactor;
                blue  *= correctionFactor;
            }
            else
            {
                red   = (255 - red) * correctionFactor + red;
                green = (255 - green) * correctionFactor + green;
                blue  = (255 - blue) * correctionFactor + blue;
            }

            return(XColor.FromRgba((int)red, (int)green, (int)blue, color.A));
        }
Esempio n. 2
0
 public void SetAsActive()
 {
     StackGrid.BackgroundColor = Color.FromRgba(0, 250, 0, 0.3);
 }