using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace _2024._11._06_Feladat3
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
        }

        private void R_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
        {
            byte r = Convert.ToByte(R.Value);
            byte g = Convert.ToByte(G.Value);
            byte b = Convert.ToByte(B.Value);

            SolidColorBrush color = new SolidColorBrush();
            color.Color = Color.FromRgb(r, g, b);
            negyzet.Fill = color;


            R_Label.Content = $"Piros (R) \n {Convert.ToInt32(R.Value)}";
            G_Label.Content = $"Zöld (G) \n {Convert.ToInt32(G.Value)}";
            B_Label.Content = $"Kék (B) \n {Convert.ToInt32(B.Value)}";
        }

        private void G_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
        {
            byte r = Convert.ToByte(R.Value);
            byte g = Convert.ToByte(G.Value);
            byte b = Convert.ToByte(B.Value);

            SolidColorBrush color = new SolidColorBrush();
            color.Color = Color.FromRgb(r, g, b);
            negyzet.Fill = color;


            R_Label.Content = $"Piros (R) \n {Convert.ToInt32(R.Value)}";
            G_Label.Content = $"Zöld (G) \n {Convert.ToInt32(G.Value)}";
            B_Label.Content = $"Kék (B) \n {Convert.ToInt32(B.Value)}";
        }

        private void B_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
        {
            byte r = Convert.ToByte(R.Value);
            byte g = Convert.ToByte(G.Value);
            byte b = Convert.ToByte(B.Value);

            SolidColorBrush color = new SolidColorBrush();
            color.Color = Color.FromRgb(r, g, b);
            negyzet.Fill = color;


            R_Label.Content = $"Piros (R) \n {Convert.ToInt32(R.Value)}";
            G_Label.Content = $"Zöld (G) \n {Convert.ToInt32(G.Value)}";
            B_Label.Content = $"Kék (B) \n {Convert.ToInt32(B.Value)}";
        }
    }
}