While I was making on my router management app I wanted to implement darkmode in an elegant way that is simple but none of the solutions suited my need so I made my own!
-
Easily integratable.
-
Simple to use.
-
Can force flat style (recommended) on all controls automatically.
-
Applicable to the entire project or a single form.
-
Highly customizable.
You can get the engine up and running in 2 simple steps.
- Set the theme you want.
Theme.LightTheme();
Theme.DarkTheme();
- Call the Update theme function and pass in the form and voila!
Theme.UpdateTheme(form: this);
- Pass a custom color palette to your theme.
Theme.CustomTheme(formBack: Color.White, controlBack: Color.Gray, controlFore: Color.Black);
- Use default winforms styling (flat style is on by default and is recommended)
Theme.UpdateTheme(form: this, flatStyle: null);
If your application uses images that you would like to turn into greyscale for darkmode you can use.
imageGreyscale(SourceImage);
And the returned image will be greyscale. Please do note that this feature carries a relatively high performance impact if used with large images as it goes pixel by pixel.
So its best suited for small images and pictures