Home

Awesome

<img src="https://raw.githubusercontent.com/PetrVobornik/ColorPicker/master/images/colorpicker-icon.png?raw=true" alt="ColorPicker" width="32" /> Color picker for Xamarin.Forms

Color picker control for Xamarin.Forms. It can be used as a large color mixer control (ColorPickerMixer) or as a dialog for select a color (ColorPickerDialog) or as an entry editor (ColorPickerEntry) of hexadecimal value with preview of a color and option of launch a dialog with color mixer. https://raw.githubusercontent.com/PetrVobornik/ColorPicker/master/README.md?raw=true

NuGet

Platform Support

Color picker control is written in C# (.NET 4.5) as .NET Standard 2.0 project and uses standard Xamarin.Forms only. It is compatible to use with UWP, Android and iOS.

Instalation

Add NuGet (or source files) to your Xamarin.Forms .NET Standard project (or to shared project). There is no need to add NuGet to platform specific projects.

Usage

ColorPickerEntry and ColorPickerMixer

<img src="https://raw.githubusercontent.com/PetrVobornik/ColorPicker/master/images/colorpicker-android-entry-mixer.png?raw=true" alt="ColorPickerEntry and ColorPickerMixer on Android" title="ColorPickerEntry and ColorPickerMixer on Android" width="45%" /> <img src="https://raw.githubusercontent.com/PetrVobornik/ColorPicker/master/images/colorpicker-uwp-entry-mixer.png?raw=true" alt="ColorPickerEntry and ColorPickerMixer on Windows (UWP)" title="ColorPickerEntry and ColorPickerMixer on Windows (UWP)" width="54%" style="float: right;" />

XAML

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:local="clr-namespace:ColorPicker.Sample"
             xmlns:cp="clr-namespace:Amporis.Xamarin.Forms.ColorPicker;assembly=Amporis.Xamarin.Forms.ColorPicker"
             x:Class="ColorPicker.Sample.MainPage">
    <Grid x:Name="gMain">
        <StackLayout HorizontalOptions="Center" VerticalOptions="Center">
            <Label Text="ColorPickerEntry" Margin="0,0,0,10" />
            <cp:ColorPickerEntry WidthRequest="150" HorizontalOptions="Start" Color="{Binding EditedColor}" />            
            <Label Text="ColorPickerMixer" Margin="0,30,0,10" />
            <cp:ColorPickerMixer Color="{Binding EditedColor}" />
        </StackLayout>
    </Grid>
</ContentPage>

C#

public partial class MainPage : ContentPage
{
    public MainPage()
    {
        InitializeComponent();
        gMain.BindingContext = this;
    }

    private Color editedColor;

    public Color EditedColor {
        get => editedColor;
        set { editedColor = value; OnPropertyChanged(); }
    }
}

There are also these properties:

ColorPickerEntry

ColorPickerMixer

ColorPickerDialog

<img src="https://raw.githubusercontent.com/PetrVobornik/ColorPicker/master/images/colorpicker-android-dialog.png?raw=true" alt="ColorPickerDialog on Android" title="ColorPickerDialog on Android" width="45%" /> <img src="https://raw.githubusercontent.com/PetrVobornik/ColorPicker/master/images/colorpicker-uwp-dialog.png?raw=true" alt="ColorPickerDialog on Windows (UWP)" title="ColorPickerDialog on Windows (UWP)" width="54%" style="float: right;" />

C#

var color = await ColorPickerDialog.Show(gMain, "ColorPickerDialog", Color.White, null);

Parameters

Acknowledgment

I'd like to thank galadril for his pull request ideas and his subversion of ColorPicker - SimpleColorPicker