MaterialSkin icon indicating copy to clipboard operation
MaterialSkin copied to clipboard

Can I create a Custom Color to replace the primary color?

Open naakmsc opened this issue 2 years ago • 1 comments

I would like to leave a specific color for the primary color in ColorScheme, but I can't find any other way than the default ones. image

naakmsc avatar May 17 '23 05:05 naakmsc

Press F12 over the ColorScheme, and it will open for you the constructors. As you will see, there are four constructors for this ColorScheme class:

  • first is the non-parametrized constructor, which will set automatically some colors for you, using the second constructor with some default values
  • second is using Primary enum, which stores some Hex values of the colors (web colors).
  • third uses int values, which will be converted to colors using ToColor() function from the Extensions.cs class
  • fourth uses Color struct.

Try to use the third or the fourth constructor:

public ColorScheme(int primary, int darkPrimary, int lightPrimary, int accent, TextShade textShade) 

or

public ColorScheme(Color primary, Color darkPrimary, Color lightPrimary, Color accent, TextShade textShade)

I probably find more usefull the fourth constructor, using Color struct.

Regards, Vali

valimaties avatar Jun 19 '23 19:06 valimaties