Giter Site home page Giter Site logo

egorozh / egorozh.colorpicker Goto Github PK

View Code? Open in Web Editor NEW
71.0 2.0 4.0 1.06 MB

🎨🎨🎨 Best of the best ColorPicker on WPF and AvaloniaUI

License: MIT License

C# 100.00%
wpf colorpicker color-picker color-palette csharp netcore avalonia avaloniaui

egorozh.colorpicker's Introduction

Nuget (with prereleases) Nuget (with prereleases) Nuget (with prereleases)

Egorozh.ColorPicker

AvaloniaUI ColorPicker:

example example example

AvaloniaUI Getting Started

Install the library as a NuGet package:

Install-Package Egorozh.ColorPicker.Avalonia.Dialog
# Or 'dotnet add package Egorozh.ColorPicker.Avalonia.Dialog'

Then, reference the preffered theme from your App.xaml file:

<Application xmlns="https://github.com/avaloniaui"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:dialog="clr-namespace:Egorozh.ColorPicker.Dialog;assembly=Egorozh.ColorPicker.Avalonia.Dialog"
             x:Class="YourNamespace.App">
  <Application.Styles>
      
      <SimpleTheme Mode="Dark"/>
      <dialog:SimpleColorTheme Mode="Dark"/>

      <!-- To use other themes:-->
      <!-- <FluentTheme Mode="Light" /> -->
      <!-- <dialog:FluentColorPickerTheme Mode="Light" /> -->

      <!-- <FluentTheme Mode="Dark" />  -->
      <!-- <dialog:FluentColorPickerTheme Mode="Dark" /> -->
  </Application.Styles>
</Application>

Done! Use ColorPickerButton

<dialog:ColorPickerButton Color="#99029344"
                          Cursor="Hand"/>

or ColorPickerDialog:

ColorPickerDialog dialog = new ()
{
  Color = _color
};

var res = await dialog.ShowDialog<bool>(Owner);

if (res)
  _color = dialog.Color;

WPF ColorPicker:

example example example example example

WPF Getting Started

Install the library as a NuGet package:

Install-Package Egorozh.ColorPicker.WPF.Dialog
# Or 'dotnet add package Egorozh.ColorPicker.WPF.Dialog'

Done! Use ColorPickerButton

<dialog:ColorPickerButton Color="#99029344"
                          Cursor="Hand"/>

or ColorPickerDialog:

var dialog = new ColorPickerDialog
{
  Owner = Owner,
  Color = Color
};

var res = dialog.ShowDialog();

if (res == true)
  Color = dialog.Color;

To run MahApps Version:

Install the library as a NuGet package:

Install-Package Egorozh.ColorPicker.WPF.Dialog.MahApps
# Or 'dotnet add Egorozh.ColorPicker.WPF.Dialog.MahApps'

Then, reference the preffered theme from your App.xaml file:

<Application x:Class="Egorozh.ColorPicker.Client.App"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
            
             StartupUri="MainWindow.xaml">

    <Application.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.xaml" />
                <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Fonts.xaml" />
                <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Themes/Dark.Crimson.xaml" />


                <ResourceDictionary Source="pack://application:,,,/Egorozh.ColorPicker.WPF.Dialog.MahApps;component/Themes/Generic.xaml" />
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Application.Resources>
</Application>

egorozh.colorpicker's People

Contributors

egorozh avatar

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  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

egorozh.colorpicker's Issues

Saving Palete Without File Extension

When saving a palete without specifically putting the file extension in the file name it throws this exception Unhandled exception. System.ArgumentOutOfRangeException: startIndex cannot be larger than length of string. (Parameter 'startIndex')

Example:
File.act -> Save -> No Error
File -> Save -> Throws Exception

Suggestion:
Also can you make it so you can paste a hex value in, thanks

Dialog customization when using ColorPickerButton

Is there any ability currently to customize the dialog when using the button? For example, removing window decorations and title bar. A quick read of the source leads me to believe there is not.

Is this something that you might consider adding to the project?

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.