using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Kolory
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
            this.hScrollBar1_ValueChanged(this, null);
        }

        private void hScrollBar1_ValueChanged(object sender, EventArgs e)
        {
            panel1.BackColor = Color.FromArgb(hScrollBar1.Value,
                                              hScrollBar2.Value,
                                              hScrollBar3.Value);
            Text = "R=" + panel1.BackColor.R.ToString() + ", " +
                   "G=" + panel1.BackColor.G.ToString() + ", " +
                   "B=" + panel1.BackColor.B.ToString();

        }

        private void Form1_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (e.KeyChar == '\u001B') Close();
        }
    }
}
