Code Monkey home page Code Monkey logo

colorpicker's Introduction


PixiEditor is a Pixel art editing software. Create beautiful sprites for your games, animations (coming soon!), and edit images. All packed in eye-friendly dark theme.

Build Status CodeFactor Release Downloads Discord Server Subreddit subscribers contributions

Check out our website pixieditor.net

About PixiEditor

Want to create beautiful pixel art for your games? PixiEditor can help you! Our goal is to create a fully open-source, fast, and feature-rich pixel art creator.

Familiar interface

Have you ever used Photoshop or Gimp? Reinventing the wheel is unnecessary, we wanted users to get familiar with the tool quickly and with ease.

Fast

PixiEditor is fast, drawing feels smooth on any canvas size, we've developed original chunk-based system and adaptive rendering to minimize pixel processing time.

Active development

PixiEditor started in 2018 and it's been actively developed since. We continuously improve code quality to ensure the best experience and performance.

Installation

Microsoft Store badge

Get it on Steam now!

Get PixiEditor on Steam

Or

Follow these instructions to get PixiEditor working on your machine.

  1. Download the zipped installer from our official website
  2. Extract the installer from the archive
  3. Launch it
  4. Follow the steps in the installer to finish the installation

Featured content

PixiEditor 1.0 Trailer

Trailer

Pixel Art Timelapse - "Bog Landscape" | PixiEditor

Landscape timelapse

Gallery

Check out some pixel arts made with PixiEditor here.

Support

Struggling with something? You can find support in a few places:

Building from source

Software Requirements

  • .NET 7

Instructions

  1. Clone Repository

  2. Open PixiEditor/src/PixiEditor/PixiEditor.sln in Visual Studio

  3. Build solution

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

License

This project is licensed under the LGPLv3 License - see the LICENSE.md - file for details

colorpicker's People

Contributors

arebrovscnsoft avatar ccfoo242 avatar equbuxu avatar flabbet avatar tonyhallett 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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar

colorpicker's Issues

Add ability to change popup in PortableColorPicker

Basically so that you can do something like this

<PortableColorPicker>
    <PortableColorPicker.ColorPicker>
        <StackPanel>
            <StandardColorPicker />
            <Button>idk</Button>
        </StackPanel>
    </PortableColorPicker.ColorPicker>
</PortableColorPicker>

HSL L slider gradient unlike others - does not represent the affect of L

When the sliders for RGB / HSV and HSL H and S are moved to a new position the selected colour is the same as that under the thumb.

Given
image

image

image

L has two gradient stops - black and white.
image

By increasing the gradient stops HSL L reflects the effect of moving the L slider on the resulting colour.
I have used 255 equally spaced stops.

image

New code required in here

protected override void GenerateBackground()

I used

            if (SliderHslType == "L")
            {
                var colorStart = GetColorForSelectedArgb(0);
                var colorEnd = GetColorForSelectedArgb(255);
                LeftCapColor.Color = colorStart;
                RightCapColor.Color = colorEnd;
                var backgroundGradient = new GradientStopCollection();
                
                var numStops = 255;
                for (var i = 0; i < numStops; i++)
                {
                    var ratio = (double)i / numStops;
                    var value = 255 * ratio;
                    backgroundGradient.Add(new GradientStop(GetColorForSelectedArgb((int)value), ratio));
                }
                BackgroundGradient = backgroundGradient;
                return;
            }

Output of Scalar values (ScR, ScG, ScB...) is non-linear?

A simple example:

2023-11-30_13-36-49__RainbowStoneMVVM

A picked color of hex:

  • 255
  • 215
  • 128
  • 255

return Scalar values of

  • 1
  • 0.679
  • 0.215
  • 1

when you'd expect it to return (float / 255), therefore:

  • 1
  • 0.84
  • 0.5
  • 1

I am using SelectedColor to bind a PortableColorPicker to a color.

Some code examples:

public Color SelectedColor
    {
        get => _selectedColor;
        set
        {
            OnPropertyChanging();
            _selectedColor = value;
            X = value.ScR;
            Y = value.ScG;
            Z = value.ScB;
            W = value.ScA;
            OnPropertyChanged();
        }
    }

    public float X
    {
        get => Value.X;
        set
        {
            if (Value.X.Equals(value) && _selectedColor.ScR.Equals(value)) return;
            OnPropertyChanging();
            OnPropertyChanging(nameof(SelectedColor));
            Value = Value with { X = value };
            _selectedColor.ScR = value;
            OnPropertyChanged();
            OnPropertyChanged(nameof(SelectedColor));
        }
    }

I don't think anything in my code is causing this.

Can't restyle parts of controls properly because they use internal components that I can't access

I would like to restyle some of the controls to fit the rest of my application, but I can't because tons of the library is marked as internal, or parts of it are hardcoded in a way that I can't restyle (such as HexColorTextBox's 70 width).

Examples:

  • I can't just create my own control template for HexColorTextBox, because it uses TextBoxFocusBehavior and ColorToHexConverter, both of which are internal
  • I cannot change the height of the sliders in ColorSliders or the size of the text boxes to the right, because the styles reference HslColorSlider etc which are internal
  • I can't use SquareSlider on its own (without the hue circle around it) because it's internal

Would it be possible to make more of these internals public?

Drop support for out-of-support .NET runtimes (.NET 4.5.2 (support 4.6.2), .NET Core 3.1 and .NET 5)

Drop support for out-of-support (end-of-life) .NET runtime version. In this case:

  • .NET Framework 4.5.2 (target 4.6.2 for now, it will be supported till 2027)
  • .NET Core 3.1
  • .NET 5

image

image

See also:

PortableColorPicker in DataGridCell: Can't switch between primary to secondary color

Hi,

thank you for your work.

I've added a PortableColorPicker to a DataGridTemplateColumn of a DataGrid. Everything looks fine so far, but I can't switch between the primary and secondary colors.

What am I doing wrong? If I use the PortableColorPicker outside of the DataGrid, the switch between the colors is possible. Even if I add the StandardColorPicker into the DataGridTemplateColumn everything is ok.

Here is my example:

<Window x:Class="MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:WpfAppTest"
        xmlns:cp="clr-namespace:ColorPicker;assembly=ColorPicker"
        mc:Ignorable="d"
        Title="MainWindow" Height="450" Width="800">

    <Window.Resources>
        <XmlDataProvider x:Key="MockList" XPath="/MockObjects/*" >
            <x:XData >
                <MockObjects xmlns="">
                    <MockObject />
                </MockObjects>
            </x:XData>
        </XmlDataProvider>
    </Window.Resources>

    <Grid DataContext="{Binding Source={StaticResource MockList}}">
        <DataGrid ItemsSource="{Binding Mode=Default, XPath=/MockObjects/MockObject}" 
                  AutoGenerateColumns="False">
            
            <DataGrid.Columns>

                <DataGridTemplateColumn Header="PortableColorPicker">
                    <DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <cp:PortableColorPicker ShowAlpha="True" Height="14"/>
                        </DataTemplate>
                    </DataGridTemplateColumn.CellTemplate>
                </DataGridTemplateColumn>

                <DataGridTemplateColumn Header="StandardColorPicker">
                    <DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <cp:StandardColorPicker ShowAlpha="True" />
                        </DataTemplate>
                    </DataGridTemplateColumn.CellTemplate>
                </DataGridTemplateColumn>

            </DataGrid.Columns>
        </DataGrid>

    </Grid>
</Window>

Thank you für your help

Addition:
The selected items will not work in this case.
image

No Hit Test wenn using inside a Popup

Place the ColorPicker inside a Popup and try to use the color wheel. You will notice that the Popup will close like it whould if you clicked outside of the popup.

RGB rounding inconsistency

The RGB values next to the sliders are rounded to the nearest whole number (N0), but the RGB values in the hex string are obtained by rounding the original values down. Because of that, the RGB values next to the sliders are sometimes off by 1.

This will be fixed soon (in the next release).

Misleading docs re: double ranges

Color property contains nested properties you may bind to or use to retrieve the color in code-behind:
Color.A: Current Alpha, a double ranging from 0 to 255
Color.RGB_R, Color.RGB_G, Color.RGB_B: Dimensions of the RGB color space, each is a 0-255 double
Color.HSV_H: Hue in the HSV color space, a 0-360 double
Color.HSV_S: Saturation in the HSV color space, a 0-100 double
Color.HSV_V: Value in the HSV color space, a 0-100 double
Color.HSL_H: Hue in the HSL color space, a 0-360 double
Color.HSL_S: Saturation in the HSL color space, a 0-100 double
Color.HSL_L: Lightness in the HSL color space, a 0-100 double

Reading this, I assumed "A double ranging from 0 to 255" to mean that the value in the number can be between 0.0 and 255.0.

In my application, I have colors and alpha saved as float ranging from 0 to 1. Reading the README for this color picker, my assumption was that I had to multiply these values by 255 to receive the values the color picker wants.

I could achieve that with the following:

        var color = new Color(); // Windows.Media
        color.ScA = W;
        color.ScR = X;
        color.ScG = Y;
        color.ScB = Z;
        var colorState = new ColorState();
        colorState.SetARGB(color.A, color.R, color.G, color.B);
        _colorState = colorState;

This would feed my 0-1 floats into a Color class, then spit them out as 0-255 bytes. This is what I assumed the ColorState wants, based on the description.

Yet in fact, I had to do this:

        var colorState = new ColorState();
        colorState.SetARGB(W, X, Y, Z);
        _colorState = colorState;

because, it seems, the color state actually expects a double from 0 to 1, not from 0 to 255.

Can't get Visual Studio 2022 to recognize ColorPicker's dependencies. What am I doing wrong?

Errors:

devenv_SJ9L5zjBVq

I just followed the instructions on the main page. Am I missing something stupid? Apologies, I am relatively new to C#.

Edit:

Somehow I got past the above errors by restarting Visual Studio, but now It's telling me that it can't find the assembly. It's definitely imported and it exists in the path VS is expecting it to be at:

devenv_3yt4pASWXY

After this, I tried opening the demo solution and still run into the same issue.

XDG0008 The name "StandardColorPicker" does not exist in the namespace "clr-namespace:ColorPicker;assembly=ColorPicker".

devenv_GqzJ2jo3ds

Any help at all would be greatly appreciated

.

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.