private void AdjustForFillColor() { // If the shape is very dark, we make the title text white, and viceversa. StyleSet.OverrideBrushColor(DiagramBrushes.ShapeText, CachedFillColorAppearance(FillColor).TextColor); // We draw a thin outline of a sligtly different color to improve distinguishability when shape color looks like background (and because it looks good). StyleSet.OverridePenColor(OutlinePenId, CachedFillColorAppearance(FillColor).OutlineColor); // We shouldn't need to do this again unless the user changes the color for this shape. _isAdjustedForFillColor = true; }
private static void SetColorTheme(StyleSet styleSet) { // TODO: Without this some test in ViewModel.Tests.csproj are failing because apparently they are non runing in VS. We should fix the tests and shouldn't need this anymore. if (!IsThemeServiceAvailable()) { return; } // Override brush settings for this diagram background. styleSet.OverrideBrushColor( DiagramBrushes.DiagramBackground, VSColorTheme.GetThemedColor(EnvironmentColors.DesignerBackgroundColorKey)); // Override lasso color for thumbnail view. styleSet.OverridePenColor(DiagramPens.ZoomLasso, VSColorTheme.GetThemedColor(EnvironmentColors.ClassDesignerLassoColorKey)); // Notify EntityTypeShape that changes will require updating themable colors on next painting. ConfigurationElementShape.IsColorThemeSet = false; // Notify all Connectors that changes will require updating themable colors on next painting. InheritanceConnector.IsColorThemeSet = false; ConfigurationElementCollectionHasItemTypeConnector.IsColorThemeSet = false; ConfigurationSectionGroupHasConfigurationSectionGroupPropertiesConnector.IsColorThemeSet = false; ConfigurationSectionPropertyHasConfigurationSectionConnector.IsColorThemeSet = false; ElementPropertyHasTypeConnector.IsColorThemeSet = false; }
private static void SetColorTheme(StyleSet styleSet) { // TODO: Without this some test in ViewModel.Tests.csproj are failing because apparently they are non runing in VS. We should fix the tests and shouldn't need this anymore. if (!IsThemeServiceAvailable()) { return; } // Override brush settings for this diagram background. styleSet.OverrideBrushColor( DiagramBrushes.DiagramBackground, VSColorTheme.GetThemedColor(EnvironmentColors.DesignerBackgroundColorKey)); // Override lasso color for thumbnail view. styleSet.OverridePenColor(DiagramPens.ZoomLasso, VSColorTheme.GetThemedColor(EnvironmentColors.ClassDesignerLassoColorKey)); // Notify EntityTypeShape that changes will require updating themable colors on next painting. EntityTypeShape.IsColorThemeSet = false; // Notify AssociationConnector that changes will require updating themable colors on next painting. AssociationConnector.IsColorThemeSet = false; }