Example #1
0
 private void OnEnable()
 {
     SetSelected(false);
     _button = GetComponent <Button>();
     GetComponent <Image>().color = color;
     _colorSection = GetComponentInParent <ColorSection>();
     _button.onClick.AddListener(() => _colorSection.ChangeSelected(this));
 }
Example #2
0
        /// <summary>
        /// Method untuk membaca konfigurasi warna yang di simpan di file app.config
        /// </summary>
        /// <param name="colorSection"></param>
        /// <returns></returns>
        private static Color GetRgbColor(ColorSection colorSection)
        {
            var rgbColor = new string[] { "0", "0", "0" };

            var colorManager = (NameValueCollection)ConfigurationManager.GetSection("colorManager");

            if (colorManager != null)
            {
                rgbColor = colorManager[colorSection.ToString()].Split(',');
            }
            else
            {
                // set warna default
                switch (colorSection)
                {
                case ColorSection.FormBackColor:
                    rgbColor = new string[] { "255", "255", "255" };
                    break;

                case ColorSection.PanelHeaderBackColor:
                    rgbColor = new string[] { "31", "86", "125" };
                    break;

                case ColorSection.PanelFooterBackColor:
                    rgbColor = new string[] { "31", "86", "125" };
                    break;

                case ColorSection.LabelHeaderForeColor:
                    rgbColor = new string[] { "255", "255", "255" };
                    break;

                case ColorSection.TextFocusColor:
                    rgbColor = new string[] { "255", "255", "192" };
                    break;

                default:
                    break;
                }
            }

            return(Color.FromArgb(Convert.ToInt32(rgbColor[0]), Convert.ToInt32(rgbColor[1]), Convert.ToInt32(rgbColor[2])));
        }
Example #3
0
 private void button4_Click(object sender, EventArgs e)
 {
     _colorsection = ColorSection.Back;
     ShowValues(BackPanel.BackColor);
 }
Example #4
0
 private void button3_Click(object sender, EventArgs e)
 {
     _colorsection = ColorSection.Press;
     ShowValues(PressPanel.BackColor);
 }
Example #5
0
 private void button4_Click(object sender, EventArgs e)
 {
     _colorsection = ColorSection.Back;
     ShowValues(BackPanel.BackColor);
 }
Example #6
0
 private void button3_Click(object sender, EventArgs e)
 {
     _colorsection = ColorSection.Press;
     ShowValues(PressPanel.BackColor);
 }