Esempio n. 1
0
        private static void LoadColors()
        {
            MenuColors.Add(typeof(StockManagementUI), ConsoleColor.Yellow);
            MenuColors.Add(typeof(PurchaseUI), ConsoleColor.Green);
            MenuColors.Add(typeof(MainMenuUI), ConsoleColor.Cyan);

            ColorDictionary.Add("logo", ConsoleColor.Blue);
            ColorDictionary.Add("logobackground", ConsoleColor.White);
            ColorDictionary.Add("special", ConsoleColor.Yellow);
            ColorDictionary.Add("erorr", ConsoleColor.Red);
            ColorDictionary.Add("confirmation", ConsoleColor.Green);
            ColorDictionary.Add("neutral", ConsoleColor.DarkYellow);
        }
        /// <summary>
        /// Initializes colors.
        /// </summary>
        private void InitializeColors()
        {
            ColorDictionary.Clear();
            ForegroundColorDictionary.Clear();

            var colorDictionary           = Extensions.ResourceDictionary.GetColorsDictionary(ResourceDictionary, ColorKey, _colorWeights);
            var foregroundColorDictionary = Extensions.ResourceDictionary.GetColorsDictionary(ResourceDictionary, ForegroundColorKey, _foregroundColorWeights);

            foreach (var pair in colorDictionary)
            {
                ColorDictionary.Add(pair.Key, pair.Value);
            }

            foreach (var pair in foregroundColorDictionary)
            {
                ForegroundColorDictionary.Add(pair.Key, pair.Value);
            }
        }
Esempio n. 3
0
    private void DrawColorDictionary(ColorDictionary dictionary)
    {
        int colorCount = Enum.GetNames(typeof(Theme.ColorMode)).Length;

        for (int i = 0; i < colorCount; i++)
        {
            Theme.ColorMode key = (Theme.ColorMode)i;
            if (!dictionary.Contains(key, out int index))
            {
                dictionary.Add(key, Color.white);
            }

            EditorGUILayout.BeginHorizontal();
            EditorGUILayout.LabelField($"{key} Color:", GUILayout.MaxWidth(150f));
            dictionary.SetValue(i, EditorGUILayout.ColorField(dictionary.GetValue(i), GUILayout.MaxWidth(150f)));
            EditorGUILayout.EndHorizontal();
        }
    }
        private void InitializeColors()
        {
            _RenderingColors.Clear();
            _RenderingColors.Add(RenderColor.NeutralPlayerLight, labelNeutralPlanetColor.ForeColor);
            _RenderingColors.Add(RenderColor.NeutralPlayerDark, labelNeutralPlanetColor.BackColor);
            _RenderingColors.Add(RenderColor.Player1Light, groupBoxPlayer1.ForeColor);
            _RenderingColors.Add(RenderColor.Player1Dark, groupBoxPlayer1.BackColor);
            _RenderingColors.Add(RenderColor.Player2Light, groupBoxPlayer2.ForeColor);
            _RenderingColors.Add(RenderColor.Player2Dark, groupBoxPlayer2.BackColor);
            _RenderingColors.Add(RenderColor.GridLight, Color.White);
            _RenderingColors.Add(RenderColor.GridDark, Color.Black);
            _RenderingColors.Add(RenderColor.GridLine, Color.DarkGray);

            _RenderingColors.Add(RenderColor.PlanetIdDark, Color.Black);
            _RenderingColors.Add(RenderColor.PlanetIdLight, Color.White);

            _RenderingColors.Add(RenderColor.FleetDistanceLight, Color.White);
            _RenderingColors.Add(RenderColor.FleetDistanceDark, Color.Black);

            _RenderingColors.Add(RenderColor.PlanetNumShipsLight, Color.White);
            _RenderingColors.Add(RenderColor.PlanetNumShipsDark, Color.Black);

            _RenderingColors.Add(RenderColor.PlanetGrowthLight, Color.PaleGreen);
            _RenderingColors.Add(RenderColor.PlanetGrowthDark, Color.DarkGreen);

            _RenderingColors.Add(RenderColor.PlanetAttackLight, Color.Magenta);
            _RenderingColors.Add(RenderColor.PlanetAttackDark, Color.Black);

            _RenderingColors.Add(RenderColor.PlanetDefenceLight, Color.LightBlue);
            _RenderingColors.Add(RenderColor.PlanetDefenceDark, Color.DarkBlue);

            _RenderingColors.Add(RenderColor.FleetIncomingAttackLine, Color.Red);
            _RenderingColors.Add(RenderColor.FleetOutgoingAttackLine, Color.Blue);
            _RenderingColors.Add(RenderColor.FleetDefensiveLine, Color.LawnGreen);



            _RenderingColors.Add(RenderColor.PlanetAttackNettoNegativeLight, Color.Red);
            _RenderingColors.Add(RenderColor.PlanetAttackNettoNegativeDark, Color.Black);
            _RenderingColors.Add(RenderColor.PlanetAttackNettoPositiveLight, Color.PaleGreen);
            _RenderingColors.Add(RenderColor.PlanetAttackNettoPositiveDark, Color.DarkGreen);
        }