Code Monkey home page Code Monkey logo

colorpicker's Introduction

NuGet

CodeFactor

ColorPicker

ColorPicker is the multi-platform pack of color pickers for Xamarin Forms.

Supported platforms

  • Android
  • iOs
  • UWP

Clor pickers

ColorWheel: color circle with alpha slider and luminosity slider.

ColorCircle: only color circle.

ColorTriangle

HSLSliders

RGBSliders

This library contains several base classes for custom color pickers.

TestApp

TestApp provides basic examples of how to use color pickers.

How to use

Add this package both to Xamarin Forms and platform-specific projects.

Add color picker as any other Xamarin Forms control.

iOS project

add

ColorPickerEffects.Init();

to AppDelegate.FinishedLaunching

UWP project

Replace

Xamarin.Forms.Forms.Init(e);

in OnLaunched of App.xaml.cs by

var rendererAssemblies = ColorPicker.UWP.ColorPickerEffects.GetRendererAssemblies();
Xamarin.Forms.Forms.Init(e, rendererAssemblies);

Useful properties

Common properties

SelectedColor It could be used to read selected color and to set the color to picker.

ConnectedColorPicker Multiple color pickers could be connected using this property. Bind color pickers one by one in chain.

WheelBackgroundColor For Color wheel and Color Triangle. Background inside outer ring.

Vertical Vertical slider.

ShowAlphaSlider

PickerRadiusScale

Color wheel

ShowLuminosityWheel

ShowLuminositySlider

colorpicker's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

colorpicker's Issues

SelectedColor binding doesn't get updated

I'm trying to use this nuget package but I've got a problem with the ColorWheel.
When the initial value of the SelectedColor is black(Color.FromHex("#FF000000")) and I use the the colorpicker to set a new value my property in the viewmodel isn't updated.
When I first set my property to another color and then update via the colorwheel my setter is triggerd
Viewmodel property:

   public Color EditedColor1
        {
            get { return _editedColor1; }
            set
            {
                _editedColor1 = value;
                Settings.AddOrUpdateValue("color1", _editedColor1.ToHex());
                RaisePropertyChanged(() => EditedColor1);
                ColorChanged(1);
            }
        }

View

<colorPicker1:ColorWheel Grid.Row="2" Grid.Column="0" x:Name="ColorWheel1" VerticalOptions="FillAndExpand"
                                    ShowAlphaSlider="False"
                                    ShowLuminositySlider="False"
                                    ShowLuminosityWheel="False" SelectedColor="{Binding EditedColor1, Mode=TwoWay}" PropertyChanged="ColorWheel1_OnPropertyChanged"
                                    />

I didn't use the nuget package itself because I'm using a newer version of Xamarin forms so I downloaded your code updated the package and used that dll.

With the slides the problem doesn't occur.

NetStandard.Library 2.1 required, latest version is 2.0.3

When I try to install this package through NuGet, it fails with the complaint that it's not compatible with NetStandard.Library 2.0 and that I need 2.1

The only issue is that there's no 2.1 NetStandard.Library available to me.
I'm on the latest release of that package and that's 2.0.3

Here's a screen showing that I can't update my version any higher
https://drive.google.com/open?id=15WOeztPKYt-MfhZPLIhBc_3YUrGJekkZ

and here's the package requiring 2.1
https://drive.google.com/open?id=1UVytQ7jorgePWdn54E7qyS-v8Jl4ZqpI

and I'm using Visual Studio Community 2017 on Windows 10 Pro

Is there anything I have to do to be able to get NetStandard.Library 2.1?

[Feature Request] Port of ColorPicker to .NET Maui

I am irked that the WINUI 3 ColorPicker is so complex and not easy to use in C# code.

I would much prefer a more straightforward implementation such as provided by this project, although I do realize that a new implementation would require creating a Handler rather than a custom Renderer.

One desirable feature enhancement would be to allow specification of, and the display of,a hex value, e.g. #rrggbbaa
with alpha, or #rrggbb without alpha (would default to 100%)

Control is not displayed in Xamarin Community Toolkit TabView

Something is wrong when the color picker is child element of TabViewItem(control -> Xamarin Community Toolkit TabView).
https://docs.microsoft.com/en-us/xamarin/community-toolkit/views/tabview

The color picker becomes transparent, but the color selection is still available.
You can swipe and see the selected color is changing.
I attached the sample which shows the issue.

Steps to reproduce the behavior:

  1. Open the sample app(TestApp.Android).
  2. Click on 'Tab 2.'
  3. Click on 'Tab 1.'
  4. See error

Expected behavior
The Color picker must be visible and displayed.

Screenshots
Screenshot 2021-11-30 at 18 24 12

Sample Project
ColorPicker-master.zip

Information

  • Device: Samsung m51, any emulator
  • OS: Android only, iOS works well
  • Version: 1.3.4.21, XF: 5.0

Conflicts between different versions of SkiaSharp that could not be resolved

Describe the bug
When I download the package I get a warning that conflicts from different versions of SkiaSharp found that could not be resolved...

To Reproduce
Steps to reproduce the behavior:

  1. Download ColorPicker.Xamarin.Forms version 1.3.4.21
  2. See warning

Expected behavior
No warning

Screenshots
Screenshot 2022-06-26 221900

Desktop (please complete the following information):

  • OS: Windows 11
  • Browser Opera GX
  • Version 11

Smartphone (please complete the following information):

  • Device: OnePlus 8 Pro
  • OS: Android 12
  • Browser Opera GX
  • Version 12

IOS Slider not works

Hi,

I'm using the ColorPicker on a multi-target. On android all works fine but on IOS the sliders of the picker not works. When I try to move them, they don't move.

Can someone who had this issue help me ?
Or is this working for someone on IOS ?

Thanks.

UWP app Unable to Generate release build for x64& ARM

Describe the bug
Unable to generate the release build, when we try to build for Processor architecture x64 & ARM

To Reproduce
Steps to reproduce the behavior:

  1. Create a new Xamarin Forms project that supports UWP.
  2. Add Color Picker Plugin
  3. Try to generate the release build with Processor architecture x64 / ARM

Expected behavior
The app should generate UWP release build for x86, x64 & ARM without any issue.

Screenshots
Screenshot 2020-09-15 at 8 16 11 PM

Desktop (please complete the following information):

  • OS: Windows 10

Screenshot 2020-09-16 at 11 46 09 AM

- Visual Studio Community 2019 (Version 4.8.04084) - Xamarin Forms 4.7.0.1351

Can you please add UWP also to it?

Is your feature request related to a problem? Please describe.
Doesn't support UWP

Describe the solution you'd like
Please include UWP

Describe alternatives you've considered

Additional context
I think it would be very easy to add UWP as skiasharp is fully supported in UWP.

ColorPicker Triangle not working inside ScrollView

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Put the colorpicker inside a scrollview
  2. Try to select color from the traingle
  3. Now observe the behavior
  4. See it is not smooth and having difficulty setting a color

Expected behavior
Scroll view "OnScrolled" event should be disabled

Desktop (please complete the following information):

  • OS: iOS, Adnroid

UWP Crash issue after updating to Xamarin Forms 5

Describe the bug
UWP app started to crash after updating the Xamarin Forms app to the latest Xamarin Forms version.

Upon Further analysis on the issue, it is identified that when ColorPicker NuGet Package is installed, it adds SkiaSharp (1.60.3) as a dependency, and the app works without any issue

Screenshot 2021-02-09 at 12 26 08 AM

SkiaSharp version gets updated, When adding/installing another NuGet package that contains a reference to higher SkiaSharp version.

Screenshot 2021-02-09 at 12 27 48 AM

As a result app crash, when the SkiSharp version gets updated to 2.80.2 from 1.60.3.

Expected behavior
App Should work without crashing.

To Reproduce
Steps to reproduce the behavior:

  1. Download Color Picker Sample from https://github.com/vpapenko/ColorPicker.Nuget.Test
  2. Install any one NuGet package, which has a higher version of SkiaSharp depedency. example: Syncfusion.Xamarin.DocIORenderer
  3. Run the app

Screenshots
Screenshot 2021-02-09 at 12 37 18 AM

Desktop:

  • OS: Windows 10
  • Version:
  • Edition: Windows 10 Pro
  • Version: 20H2
  • OS build: 19042.746
  • Experience: Windows Feature Experience Pack 120.2212.551.0

Additional context
Please find the attached sample code with the crash issue.
ColorPicker.Nuget.Test-master (2).zip

Issue with colorpicker in detail view of FreshMVVM

I'm using FreshMVVM and the master detail navigation container. This seems to cause an issue when the colorpicker is in a detail view (iOS only). Pressing on a new location works fine but dragging the selected circle causes the wheel to freeze. I'm guessing it's due to the fact you can slide to open the menu

Ideally the colorpicker would work in the detail view

I can create a sample project if that would help

add ColorChanged event

I am trying to build a app, where you get a preview of the current settings. DataBinding is not an option here.

Would it be possible, to add a ColorChanged Event, similar to the TextChanged/ Pressed Events of the Entry/ Button Class?

like:<Button Pressed="ButtonPressedEvent"/>
->
<ColorCircle ColorChanged="ColorChangedEvent"

Dragging on iOS prevents further interaction

Describe the bug
Dragging the sliders on the controls on iOS will move the slider a small amount and then stop. Afterwards no further interaction (pressing or sliding) will move the slider.

To Reproduce
Steps to reproduce the behavior:

  1. Add a HSLSliders control to NavigationPage(I've tried both TabbedPage and ContentPage, both within a FlyoutPage)
  2. Slide the circular slider on the control
  3. After releasing (or it stops moving) try sliding it again or pressing elsewhere on the control
  4. No further interaction happens

Expected behavior
The slider should move to the tapped location, or be able to moved via pressing and sliding

Smartphone (please complete the following information):

  • Device: iPhone SE
  • OS: iOS 14.8.1
  • Version: 1.3.4.21
  • Xamarin Forms: 5.0.0.2291

Additional context
Also, trying to slide any of the sliders to the right just instead results in the flyout page menu being displayed.

UWP problem on Multi-targeting Library

I'm trying to create a multiple-targeting library for Xamarin(Android, IOS and UWP.) I examined project files of some multi-targeting xamarin libraries. (Such as Rg.Plugins.Popup, Xamarin.Essentials, MvvmCross) and edited the csproj file of my library(XamTemel.Ortak) like this.

<Project Sdk="MSBuild.Sdk.Extras/3.0.22"> <PropertyGroup> <TargetFrameworks>netstandard2.0;Xamarin.iOS10;monoandroid10.0;</TargetFrameworks> <TargetFrameworks Condition=" '$(OS)' == 'Windows_NT' ">$(TargetFrameworks);uap10.0.17763;</TargetFrameworks> <DebugType>portable</DebugType> <Configurations>Debug;Release</Configurations> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)'=='Debug' "> <DebugSymbols>true</DebugSymbols> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)'=='Release' And '$(OS)' == 'Windows_NT' "> <!-- sourcelink: Declare that the Repository URL can be published to NuSpec --> <PublishRepositoryUrl>true</PublishRepositoryUrl> <!-- sourcelink: Embed source files that are not tracked by the source control manager to the PDB --> <EmbedUntrackedSources>true</EmbedUntrackedSources> <!-- sourcelink: Include PDB in the built .nupkg --> <AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder> </PropertyGroup> <ItemGroup> <Compile Remove="Platforms\**\*.cs" /> <None Include="Platforms\**\*.cs" /> </ItemGroup> <ItemGroup Condition=" $(TargetFramework.StartsWith('monoandroid')) "> <None Remove="Platforms\Android\**\*.cs" /> <None Remove="Platforms\Xamarin\**\*.cs" /> <Compile Include="Platforms\Android\**\*.cs" /> <Compile Include="Platforms\Xamarin\**\*.cs" /> <AndroidResource Include="Resources\**\*.xml" SubType="Designer" Generator="MSBuild:UpdateAndroidResources" /> <AndroidResource Include="Resources\**\*.json" Generator="MSBuild:UpdateAndroidResources" /> </ItemGroup> <ItemGroup> <PackageReference Include="ColorPicker.Xamarin.Forms" Version="1.3.4.11" /> </ItemGroup> </Project>

As you can see I am going to put platform renderers in Platform/Android-IOS-UWP etc. Not this works fine on Android. But ColorPicker library gives me this error on UWP.

available

I don't understand why it cannot find ColorPicker. Version number seems okay. What am I doing wrong?

Here is the sample solution.

https://drive.google.com/file/d/1PnqFyzDmTBom6GH9YVdbyBvNwikitYlC/view?usp=sharing

SelectedColor Binding Not Updateing ViewModel

Describe the bug
When I try to bind the SelectedColor to a ViewModel class it gets the value, but won't set it

To Reproduce
Steps to reproduce the behavior:

  1. Create a project and get ColorPicker all set up according to instructions
  2. Add using Xamarin.Forms ViewModel binding by using the BindingContext in the xaml
  3. Add a property to the ViewModel of type Xamarin.Forms.Color with a get and set
  4. Add a ColorPicker to the xaml and use standard binding format to bind it to the view model property
  5. Run the project and change the color on the color wheel

Expected behavior
I would expect my view model property SET to be called any time the color changes.

Desktop (please complete the following information):

  • OS: iOS
  • Version: Latest

Additional context
If I change my xaml to be similar to the TestApp project so that another control in the xaml uses a reference binding then it work, but only if I remove my binding to my view model property. If they are both there, then neither one updates.

Note that when I have my view model binding in place and I set a break point in the GET of my property it does hit it and retrieves the color just fine.

Here is my xaml:

<StackLayout Orientation="Vertical" BackgroundColor="{Binding Source={x:Reference LabelColorWheel}, Path=SelectedColor}">
<colorpicker:ColorCircle x:Name="LabelColorWheel" SelectedColor="{Binding LabelColor}"/>
</StackLayout>

Here is my view model:

private Color _labelColor;
public Color LabelColor
{
get { return _labelColor; }
set
{
if (_labelColor != value)
{
_labelColor = value;
SafePropertyChanged("LabelColor");
}
}
}

I am sorry my formatting isn't very good. It doesn't seem to paste code like I expect.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.