Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

All generated colors are opaque #11

Open
lhak opened this issue Oct 12, 2018 · 13 comments
Open

All generated colors are opaque #11

lhak opened this issue Oct 12, 2018 · 13 comments

Comments

@lhak
Copy link

lhak commented Oct 12, 2018

All color values generated by the tool have an alpha value of 255, compared to the default system colors that are partially transparent. This creates issues for example for the NavigationView if transparency effects are disabled (the pointer over effect is not visible with a color scheme exported by the tool).

@kikisaints
Copy link
Contributor

Hmm, they were intentionally made opaque so that your brand and background (region) choices would be true to color. You should be seeing something when you hover, nothing at all when things are opaque seems odd - could you post your markup and your exported theme so I can test it?

@mdtauk
Copy link

mdtauk commented Oct 12, 2018

The default colours use a base colour be it Chrome or Alt etc and these vary in opacity to distinguish from each other.

The tool replaces those with shades of opaque colours derived from your chosen base colour with white or black added to create shades to distinguish them.

If is extra effort of course, but it would be nice to have a checkmark option set to Opaque by default which would switch between Transparent shades, or Opaque ones. That is providing ColorPalletteResources support alpha shades

@kikisaints
Copy link
Contributor

It does support alpha, in the same way that an 8 character color hex code does. The properties on ColorPaletteResources are Colors, so it doesn't have the notion of opacity (like our SystemBrushes do).

This means that any SystemBrushes with opacities set on them will not get overwritten when you use the generated theme. But any SystemColors that would have previously had alphas defined in their hex will be overwritten.

I'll look into adding a way to toggle them on/off.

@mdtauk
Copy link

mdtauk commented Oct 13, 2018

Having an opacity option would make it easier to create tweaked versions of the Light and Dark themes, where the Blacks and Whites are not pure #FFF and #000

@lhak
Copy link
Author

lhak commented Oct 13, 2018

To reproduce the issue you can use the default color scheme exported by the editor and the following markup:

	<NavigationView>
		<NavigationView.MenuItems>
			<NavigationViewItem Icon="Add" >Test</NavigationViewItem>
			<NavigationViewItem Icon="Add" >Test2</NavigationViewItem>
		</NavigationView.MenuItems>
		<NavigationView.Content>
			<TextBlock></TextBlock>
		</NavigationView.Content>
	</NavigationView>

After disabling transparency effects in the windows color settings, the pointer over effect of the navigation menu items is gone. Without the exported color scheme, the pointer over effect is shown.

@touseefbsb
Copy link

so does that mean it cannot support acrylic?

@kikisaints
Copy link
Contributor

Acrylic colors are not an attached property on ColorPaletteResources, but all of our default AcrylicBrushes draw from three SystemColors: SystemAccentColor, SystemChromeAlteMediumHighColor, and SystemChromeAltHighColor.

Accent color is already covered in the API, but if you put any of other two definitions within the ColorPaletteResources' tag, like this:

<ColorPaletteResources Accent="#FF0073CF" AltHigh="#FF000000" AltLow="#FF000000" AltMedium="#FF000000"
                       AltMediumHigh="#FF000000" AltMediumLow="#FF000000" BaseHigh="#FFFFFFFF" 
                       BaseLow="#FF333333" BaseMedium="#FF9A9A9A" BaseMediumHigh="#FFB4B4B4" 
                       BaseMediumLow="#FF676767" ChromeAltLow="#FFB4B4B4" ChromeBlackHigh="#FF000000" 
                       ChromeBlackLow="#FFB4B4B4" ChromeBlackMedium="#FF000000" ChromeBlackMediumLow="#FF000000" 
                       ChromeDisabledHigh="#FF333333" ChromeDisabledLow="#FF9A9A9A" ChromeGray="#FF808080" 
                       ChromeHigh="#FF808080" ChromeLow="#FF151515" ChromeMedium="#FF1D1D1D" ChromeMediumLow="#FF2C2C2C" 
                       ChromeWhite="#FFFFFFFF" ListLow="#FF1D1D1D" ListMedium="#FF333333" >
    
    <Color x:Key="SystemChromeAltHighColor">#ff33e527</Color>
    <Color x:Key="SystemChromeAltMediumHighColor">#ff33e527</Color>

</ColorPaletteResources>

You will overwrite the system default Acrylic colors and your definition will also get the ColorPaletteResources' scoping behavior.

@touseefbsb
Copy link

Question : Why are these 2 colors not being generated by the theme editor, any specific reason for that?

@kikisaints
Copy link
Contributor

Partly because there is some ambiguity between whether or not an AcrylicBrush's coloring system falls into the category of "Primary" or "Base", in terms of the editor's capabilities. And partly because of an oversight 😅

Feel free to open a separate issue on this editor for that request.

@MartinZikmund
Copy link

I have hit this problem with the ContentDialog - after using Fluent XAML Theme Editor-generated theme, all dialogs have a solid black or solid white background (depending on the theme), instead of semi-transparent one. At least in this particular case the transparency is quite vital.

@kikisaints
Copy link
Contributor

Yikes! Thanks for point this out, I'll go and see what's up with applied generated themes.

@wbokkers
Copy link

I have the same issue with flyouts when using the LightDismissOverlayMode.

@Blackout8099
Copy link

Was this ever resolved?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants