Change the base color of the "Default" theme

4 posts, 0 answers
  1. Doug
    Doug avatar
    50 posts
    Member since:
    Jul 2012

    Posted 09 May 2013 Link to this post

    I've read posts about color blending and I think that is no longer available.  I would like to create some theme options for the user to pick from a color dialog (attached image) and apply that color as the color of the "Default" theme.  What is the way to do that now?

    Thank you,
    Gary
  2. Anton
    Admin
    Anton avatar
    167 posts

    Posted 14 May 2013 Link to this post

    Hello Gary,

    Thank you for writing.

    Yes, you are right that color blending is no longer supported. Currently, you have two options:

    1. To create several different themes with different predefined colors and user to be able to choose between them.
    2. To change the theme at runtime. The following code snippet demonstrates how to iterate through all repositories and how to access some specific style group at run time.
    //iterate through all repositories
    Theme theme = ThemeRepository.FindTheme("ControlDefault");
    if (theme != null)
    {
        foreach (StyleRepository repository in theme.Repositories)
        {
            
             
        }
    }
     
    //access some specific style group
    Theme controlDefaultTheme = ThemeRepository.FindTheme("ControlDefault");
    StyleGroup group = controlDefaultTheme.FindStyleGroup("Telerik.WinControls.UI.RadGridView");
     
    foreach (PropertySettingGroup settingGroup in group.PropertySettingGroups)
    {
        if (settingGroup.Selector.Value == "GridHeaderCellElement")
        {
            foreach (PropertySetting property in settingGroup.PropertySettings)
            {
                if (property.Name == "BackColor2")
                {
                     
                }
            }
        }
    }

    I hope this information helps.

    All the best,
    Anton
    the Telerik team
    RadChart for WinForms is obsolete. Now what?
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Doug
    Doug avatar
    50 posts
    Member since:
    Jul 2012

    Posted 28 May 2013 Link to this post

    I was thinking that I want to do option 1 and load "ControlDefault" into Visual Style Builder, change some colors, and save it as a new theme...several times to get a basic green, red, indigo, etc. themes.  I started down this path in the forum earlier and am just now returning to it.  Do I need to change colors on every control or is there some place to set colors that will affect all the controls?
  5. Anton
    Admin
    Anton avatar
    167 posts

    Posted 31 May 2013 Link to this post

    Hi Gary,

    Thank you writing back.

    There is no such property that you can change to change the color of each control from our suite. However, when we were creating our themes we were trying to set every property with repository. A repository is a predefined set of properties that can be applied to some primitive or element. These repositories are reused for more than one control. For example, we have fill repository that sets some blue color for background so, this repository is applied for every element in our controls that should display this color. So, the best way to change colors in the theme is to change the colors in the repositories. Each theme has hundreds of repositories, so this will be not fast and easy task, but is the most suitable way to achieve your goal.

    I hope this information helps.

    Regards,
    Anton
    Telerik
    RadChart for WinForms is obsolete. Now what?
Back to Top