public static async Task InitialzeWithMaterialDesign(this IApp app,
                                                             BaseTheme baseTheme             = BaseTheme.Light,
                                                             PrimaryColor primary            = PrimaryColor.DeepPurple,
                                                             SecondaryColor secondary        = SecondaryColor.Lime,
                                                             ColorAdjustment?colorAdjustment = null)
        {
            string colorAdjustString = "";

            if (colorAdjustment != null)
            {
                colorAdjustString = "ColorAdjustment=\"{materialDesign:ColorAdjustment}\"";
            }

            string applicationResourceXaml = $@"<ResourceDictionary 
xmlns=""http://schemas.microsoft.com/winfx/2006/xaml/presentation""
xmlns:x=""http://schemas.microsoft.com/winfx/2006/xaml""
xmlns:materialDesign=""http://materialdesigninxaml.net/winfx/xaml/themes"">
    <ResourceDictionary.MergedDictionaries>
        <materialDesign:BundledTheme BaseTheme=""{baseTheme}"" PrimaryColor=""{primary}"" SecondaryColor=""{secondary}"" {colorAdjustString}/>

        <ResourceDictionary Source = ""pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Defaults.xaml"" />
    </ResourceDictionary.MergedDictionaries>
</ResourceDictionary>";

            await app.Initialize(applicationResourceXaml,
                                 Path.GetFullPath("MaterialDesignColors.dll"),
                                 Path.GetFullPath("MaterialDesignThemes.Wpf.dll"),
                                 Assembly.GetExecutingAssembly().Location);
        }
Ejemplo n.º 2
0
 protected override void EnableProperties()
 {
     Segments.IsVisibleWhen(SegmentColors, s => s.CurrentValue);
     GradientColor.IsVisibleWhen(ColorType, c => c.BaseValue == ColorMappingType.Gradient);
     MainColor.IsVisibleWhen(ColorType, c => c.BaseValue == ColorMappingType.Simple);
     SecondaryColor.IsVisibleWhen(ColorType, c => c.BaseValue == ColorMappingType.Simple);
 }
Ejemplo n.º 3
0
 public void MergeFrom(ClientRecipe other)
 {
     if (other == null)
     {
         return;
     }
     if (other.Id.Length != 0)
     {
         Id = other.Id;
     }
     if (other.Name.Length != 0)
     {
         Name = other.Name;
     }
     if (other.Description.Length != 0)
     {
         Description = other.Description;
     }
     if (other.Icon.Length != 0)
     {
         Icon = other.Icon;
     }
     if (other.Model.Length != 0)
     {
         Model = other.Model;
     }
     if (other.CollectFx.Length != 0)
     {
         CollectFx = other.CollectFx;
     }
     if (other.CraftingFx.Length != 0)
     {
         CraftingFx = other.CraftingFx;
     }
     if (other.RevealFx.Length != 0)
     {
         RevealFx = other.RevealFx;
     }
     if (other.primaryColor_ != null)
     {
         if (primaryColor_ == null)
         {
             PrimaryColor = new global::WUProtos.Data.Color();
         }
         PrimaryColor.MergeFrom(other.PrimaryColor);
     }
     if (other.secondaryColor_ != null)
     {
         if (secondaryColor_ == null)
         {
             SecondaryColor = new global::WUProtos.Data.Color();
         }
         SecondaryColor.MergeFrom(other.SecondaryColor);
     }
     if (other.Index != 0)
     {
         Index = other.Index;
     }
     _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
 }
Ejemplo n.º 4
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = PrimaryColor.GetHashCode();
         hashCode = (hashCode * 397) ^ SecondaryColor.GetHashCode();
         hashCode = (hashCode * 397) ^ StandbyColor.GetHashCode();
         return(hashCode);
     }
 }
Ejemplo n.º 5
0
 public Brush CreateBrush(bool swapColors)
 {
     if (!swapColors)
     {
         return(BrushInfo.CreateBrush(PrimaryColor.ToColor(), SecondaryColor.ToColor()));
     }
     else
     {
         return(BrushInfo.CreateBrush(SecondaryColor.ToColor(), PrimaryColor.ToColor()));
     }
 }
Ejemplo n.º 6
0
 public Pen CreatePen(bool swapColors)
 {
     if (!swapColors)
     {
         return(PenInfo.CreatePen(BrushInfo, PrimaryColor.ToColor(), SecondaryColor.ToColor()));
     }
     else
     {
         return(PenInfo.CreatePen(BrushInfo, SecondaryColor.ToColor(), PrimaryColor.ToColor()));
     }
 }
Ejemplo n.º 7
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (Id.Length != 0)
            {
                hash ^= Id.GetHashCode();
            }
            if (Name.Length != 0)
            {
                hash ^= Name.GetHashCode();
            }
            if (Description.Length != 0)
            {
                hash ^= Description.GetHashCode();
            }
            if (Icon.Length != 0)
            {
                hash ^= Icon.GetHashCode();
            }
            if (Model.Length != 0)
            {
                hash ^= Model.GetHashCode();
            }
            if (CollectFx.Length != 0)
            {
                hash ^= CollectFx.GetHashCode();
            }
            if (CraftingFx.Length != 0)
            {
                hash ^= CraftingFx.GetHashCode();
            }
            if (RevealFx.Length != 0)
            {
                hash ^= RevealFx.GetHashCode();
            }
            if (primaryColor_ != null)
            {
                hash ^= PrimaryColor.GetHashCode();
            }
            if (secondaryColor_ != null)
            {
                hash ^= SecondaryColor.GetHashCode();
            }
            if (Index != 0)
            {
                hash ^= Index.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
Ejemplo n.º 8
0
        public MainWindow()
        {
            InitializeComponent();

            overtoggle.IsChecked = Properties.Settings.Default.overing;
            theme.IsChecked      = Properties.Settings.Default.theme;
            toggle.IsChecked     = Properties.Settings.Default.txtdel;

            PrimaryColor   primary        = PrimaryColor.DeepPurple;
            Color          primaryColor   = SwatchHelper.Lookup[(MaterialDesignColor)primary];
            SecondaryColor secondary      = SecondaryColor.Teal;
            Color          secondaryColor = SwatchHelper.Lookup[(MaterialDesignColor)secondary];
            IBaseTheme     baseTheme      = Theme.Light;
            ITheme         themee         = Theme.Create(baseTheme, primaryColor, secondaryColor);
        }
Ejemplo n.º 9
0
    public void makeColors()
    {
        ++rounds;
        deleteSecondary();
        shuffleColors();
        int idx = (int)Random.Range(0.0f, 3.0f);

        while (prevColor == Constants.secondaryColors[idx])  //Ensures the new chosen color is not the same as the previous
        {
            idx = (int)Random.Range(0.0f, 3.0f);
        }

        chosenColor = Constants.secondaryColors[idx];
        prevColor   = chosenColor;

        secondaryColor = (GameObject)Instantiate(Resources.Load(Constants.secondaryPath + chosenColor),
                                                 secondaryPosition, secondayRotation);

        color = new SecondaryColor(chosenColor);

        beniAudio.clip = (AudioClip)Resources.Load(Constants.aColorsPath + chosenColor);
        beniAudio.Play();   //Play prompt for selected secondary color
    }
Ejemplo n.º 10
0
 public static Color ConvertSecondaryColor(SecondaryColor secondaryColor)
 {
     return(SwatchHelper.Lookup[(MaterialDesignColor)secondaryColor]);
 }
Ejemplo n.º 11
0
 protected bool Equals(ColorSettings other)
 {
     return(PrimaryColor.Equals(other.PrimaryColor) && SecondaryColor.Equals(other.SecondaryColor) && StandbyColor.Equals(other.StandbyColor));
 }