Untitled

mail@pastecode.io avatar
unknown
plain_text
2 months ago
587 B
1
Indexable
Never
public partial class MainPage : ContentPage
{
    public MainPage()
    {
        InitializeComponent();

    }

    private void Slider_ValueChanged(object sender, ValueChangedEventArgs e)
    {
        var red = sldRed.Value;
        var green = sldGreen.Value;
        var blue = sldBlue.Value;

        Color color = Color.FromRgb(red, green, blue);

        SetColor(color);
    }

    private void SetColor(Color color)
    {
        btnRandom.BackgroundColor = color;
        Container.BackgroundColor = color;
        lblHex.Text = color.ToHex();
    }
}
Leave a Comment