Changeset 12 for Common/Theme.cs


Ignore:
Timestamp:
Mar 14, 2020, 1:11:28 PM (5 years ago)
Author:
chronos
Message:
  • Modified: Improved classes.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Common/Theme.cs

    r4 r12  
    1 using System;
     1using System;
    22using System.Collections.Generic;
    33using System.Linq;
     
    77using System.Drawing;
    88using System.ComponentModel;
     9using System.IO;
    910
    1011namespace Common
     
    6162        }
    6263
     64        public static Color AdjustColor(Color color)
     65        {
     66            if (color == Color.White) color = ColorWindow;
     67            else if (color == Color.Black) color = ColorWindowText;
     68            else
     69            {
     70                if (Name == "Dark")
     71                {
     72                    // Exchange dark with light colors and vice versa
     73                    if (color == Color.DarkBlue) color = Color.LightBlue;
     74                    if (color == Color.LightBlue) color = Color.DarkBlue;
     75                    else if (color == Color.DarkGreen) color = Color.LightGreen;
     76                    else if (color == Color.LightGreen) color = Color.DarkGreen;
     77                    else if (color == Color.DarkRed) color = Color.LightCoral;
     78                    else if (color == Color.LightCoral) color = Color.DarkRed;
     79                    else if (color == Color.PowderBlue) color = Color.Navy;
     80                    else if (color == Color.Navy) color = Color.PowderBlue;
     81                    else if (color == Color.LightCyan) color = Color.DarkCyan;
     82                    else if (color == Color.DarkCyan) color = Color.LightCyan;
     83                    else if (color == Color.Cyan) color = Color.Teal;
     84                    else if (color == Color.Teal) color = Color.Cyan;
     85                    else if (color == Color.Yellow) color = Color.Brown;
     86                    else if (color == Color.Brown) color = Color.Yellow;
     87                    else if (color == Color.LightGray) color = Color.DarkGray;
     88                    else if (color == Color.DarkGray) color = Color.LightGray;
     89                }
     90            }
     91
     92            return color;
     93        }
     94
    6395        public static void ApplyTheme(Component component)
    6496        {
Note: See TracChangeset for help on using the changeset viewer.