Home > Mobile >  Creating shiny colors in WPF
Creating shiny colors in WPF

Time:12-13

I was wondering how i could create a color gradient that looks like light is shining on it. Similar to this:

Shiny colors

By just using 1 color from the array it looks like this, which is awefull:

1 color

I'm using it with Livecharts.WPF. OR is there a fundamental design necessary like an image from Photoshop to create dashboards like this in WPF?

I was thinking about multiple gradients inside of eachother but i cant get the desired effect.

CodePudding user response:

You're faced with two issues to achieve the effects you're looking for. First, the shiny style, second is the reflection effect.

The reflection effect can be achieved with this control/code. Silverlight themes ported to WPF

I have these themes somewhere but was only able to find this one ShinyRed.xaml, I will look further for you. Add ShinyRed.xaml to your project then define it in your App.xaml with this code.

<Application x:Class="YoutubeTransfer.App"
         xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
         xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
         StartupUri="MainWindow.xaml"  >
<Application.Resources>
    <ResourceDictionary Source="/Theme/ShinyRed.xaml">
        <ResourceDictionary.MergedDictionaries>
            <ResourceDictionary Source="ShinyRed.xaml"/>
        </ResourceDictionary.MergedDictionaries>
    </ResourceDictionary>
</Application.Resources>

Ultimately shiny themes are available for free and can be found online. You can either use those as they are or use them as a template to create your own theme. It will be much work to create your own. The second step will be adding the reflection to get the desired effect.

Additionally, syncfusion.com has a free tier and have tools to create themes but none are shiny. Perhaps you can use that tool and customize your theme with shiny features. Syncfusion WPF Theme Studio

  • Related