diff options
| author | Alex-TIMEHACK <[email protected]> | 2017-09-23 17:25:22 +0100 |
|---|---|---|
| committer | Alex-TIMEHACK <[email protected]> | 2017-09-23 17:25:22 +0100 |
| commit | 350e749bb9eab16efe753f9b8fd703b52a97f808 (patch) | |
| tree | 9c90ec1a8148d66d9ff8605710a992e5e14a6b7e /Histacom2.Engine/Paintbrush.cs | |
| parent | 84ef033af262343febc3f84471233e18bc6b502e (diff) | |
| parent | 1ee3e00f8f0ee879fce4edf7d1ba9889335bc826 (diff) | |
| download | histacom2-350e749bb9eab16efe753f9b8fd703b52a97f808.tar.gz histacom2-350e749bb9eab16efe753f9b8fd703b52a97f808.tar.bz2 histacom2-350e749bb9eab16efe753f9b8fd703b52a97f808.zip | |
Merge branch 'master' of https://github.com/Histacom2-Devs/Histacom2
Diffstat (limited to 'Histacom2.Engine/Paintbrush.cs')
| -rw-r--r-- | Histacom2.Engine/Paintbrush.cs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/Histacom2.Engine/Paintbrush.cs b/Histacom2.Engine/Paintbrush.cs index 320b80d..ff715d2 100644 --- a/Histacom2.Engine/Paintbrush.cs +++ b/Histacom2.Engine/Paintbrush.cs @@ -45,5 +45,23 @@ namespace Histacom2.Engine // Draw the line. e.Graphics.DrawLine(new Pen(foreColor), 4, height / 2, width - 4, height / 2); } + + public static Color GetLightFromColor(Color basecolor) + { + if (basecolor == Color.Silver) return Color.White; + if (basecolor == Color.Green) return Color.FromArgb(64, 255, 64); + if (basecolor == Color.FromArgb(112, 112, 112)) return Color.FromArgb(184, 184, 184); + if (basecolor == Color.FromArgb(169, 200, 169)) return Color.FromArgb(218, 223, 218); + return ControlPaint.Light(basecolor, 70); + } + + public static Color GetDarkFromColor(Color basecolor) + { + if (basecolor == Color.Silver) return Color.Gray; + if (basecolor == Color.Green) return Color.FromArgb(0, 83, 0); + if (basecolor == Color.FromArgb(112, 112, 112)) return Color.FromArgb(72, 72, 72); + if (basecolor == Color.FromArgb(169, 200, 169)) return Color.FromArgb(95, 153, 95); + return ControlPaint.Dark(basecolor, 70); + } } } |
