Home

Awesome

vcolorpicker

Simple visual Color Picker with a modern UI created with Qt to easily get color input from the user.

colorpicker

Installation

  1. Install using pip:

    pip install vcolorpicker
    

    or clone the repository yourself and run:

    pip install .
    

Usage

  1. To ask for a color, import the getColor function and run it:

    from vcolorpicker import getColor
    
    color = getColor()
    

Customization

Color Formats and Conversion

Compatibility

This package is compatible with Python 3.7+ and above. It uses qtpy under the hood, so it should work with all Qt bindings (PyQt5, PySide2, PySide6, PyQt6).

Previous versions

In previous versions you had to create a ColorPicker object first and then
call it's getColor method. This is still supported, you just have to
import the ColorPicker class.

The color conversion functions are not methods anymore, you can import them
directly with from vcolorpicker import hsv2rgb, rgb2hsv.

You also had to create a QApplication object before being able to run the
ColorPicker, now it automatically creates one by itself if there isn't one yet.
If you need to get the auto-created application, you can use this:

from PyQt5.QtWidgets import QApplication
app = QApplication.instance()

Bugs and Improvement ideas

If you find a bug, you can open an issue or write me an email (nlfmt@gmx.de)
and I will try to get to it as fast as possible, or you can implement it
yourself and create a pull request.

License

This software is licensed under the MIT License.
More information is provided in the dedicated LICENSE file.