HCL Sliders

HCL Sliders is a color slider plugin with various hue/colorfulness/lightness models for use with the sRGB color profile and its linear counterpart.

Mainly wanted to select colors while maintaining relative chroma so i studied how Pigment.O made the sliders and implemented my own.

At the same time i learned about the oklab color space so i implemented OKHSV and OKHSL from Björn Ottosson.
The model named OKHCL is very different from OKLCH. C in OKHCL is chroma relative to the max chroma of the hue in the sRGB gamut while L is the new lightness estimate used in OKHSL.

For the CSS syntax, it only outputs and accepts hexadecimal, OKLAB and OKLCH notations as of now.

34 Likes

Thank you so much for making this, I’ve been looking for something exactly like this for a loong time!!

2 Likes

very glad to hear this!

i was taught how to use hsv and the general guideline is to increase saturation when lowering value for transitioning from light to dark. how much saturation to increase was always a mystery to me and the colors i picked often tend to be too desaturated for my liking.

so i sampled a few artworks i like and compared the colors in light and shadow on the same object. i found out that the difference between chroma is slight compared to the difference between saturation. thus this plugin was made.

my current favourite model is my OKHCL one because it gets closest to what i like for a shadow color by just lowering the lightness slider.

3 Likes

Awesome plugin! It’s exactly what i’ve been looking for! Thank you very much!!

1 Like

Hi, I dunno if this is a bug or something, but after setting up the plugin and closing Krita, it reverts back to it’s default settings?

Here, I’ve removed all the Sliders as an example and placed it in the corner.

This is what happens after I close Krita and open in again.

Could you look into it? This is a really cool plugin I was hoping to build a workspace with it.
Also, I don’t know if this matters but I’m on Windows using Krita 5.2.2

1 Like

That seems to be an issue with your installation, because it remembers the state it was closed in and offers that state after a restart of Krita.
Tested using Windows 10 Pro and Krita 5.2.2 & 5.3.0-prealpha (git cd023af).

Michelist

1 Like

I don’t think so? I just tried it with a pre-alpha I downloaded recently, same result.
Prealpha

I’m thinking about reinstalling the plugin later. Seeing if anything changes.

1 Like

I can not tell how many downloads and installations of this plugin exist. But I know that we usually would have seen more reports, like yours, if the behavior you describe would be the common behavior of this plugin. So, it may not be the particular installation, but it seems that there is something different with your PC.

By the way, did you check this using different user-accounts or different PCs or did you check it on the same machine using the same account, this would speak for an issue somewhere in your configuration, because using the same user-account means using the same settings, because these are shared in a user-account.

My tests are all made using different accounts and therefore no shared configuration.

Michelist

1 Like

hey thx for reporting this bug! i tested and it indeed resets if you uncheck every channel. will be uploading a fix very soon.

2 Likes

Aha, I have to uncheck the channels, well then we played in different playgrounds. :slight_smile:

Michelist

1 Like

i’ve uploaded the fix, hope it works for you!

@Michelist
haha the problem was if it reads an empty string from the settings, it should load the default order. however if you unchecked all channels, it is saved as an empty string.

1 Like

very happy that it fits your needs! this plugin has just been updated to fix loading of empty channels at krita startup.

3 Likes

Yay!! It works now! :smiley:
Thx for the quick response, it’s appreciated.
you to @Michelist :+1:

3 Likes

Hi! @Lucifer, I like to this plug-in and Thank you!
I especially liked that could change BackGroundColor by CTRL-clicking on the history color.
Cheers!!

By the way,If slider group spacing would enable setting from configure it might visual visibillty more clealy.
For example

3 Likes

ooh thanks for the suggestion. i will probably implement the spacing one instead of separation by line.

i will also update the sliders to switch mode from foreground to background in the future. my idea is by clicking on the top color panel, you can switch color selection mode from foreground to background for the sliders without swapping the colors in krita. will that be good?

1 Like

It is nice idea!! become more convinience.
I’m looking forward to next release.

1 Like

Hi @Lucifer ,I found hclsliders.py in traceback log, so report it to you.

I tried load a tiff format file data from the thead Fill Tool lag (again and again) in Krita Artist org.
The test image file inside in obsidian-couv-encr300.zip,so it have to unzip.

Choose ‘Yes’ at dialog that appeared when the file loaded.
It seems that contain PSD data.
Also The error happened whether answer YES or NO.
I got a following Error is outputed

TypeError:Convert.rgbToHexS() missing 1 required positional argument:‘trc’

TypeError
Python 3.10.7: /Applications/krita.app/Contents/MacOS/krita
Mon Apr 22 08:09:48 2024

A problem occurred in a Python script.  Here is the sequence of
function calls leading up to the error, in the order they occurred.

 /Users/*****/Library/Application Support/krita/pykrita/hclsliders/hclsliders.py in getKritaColors(self=<hclsliders.hclsliders.HCLSliders object>)
 1170                 rgb = tuple(foreground.componentsOrdered()[:3])
 1171                 trc = self.profileTRC(foreground.colorProfile())
 1172                 self.updateSyntax(rgb, trc)
 1173                 if trc != self.trc:
 1174                     rgb = Convert.rgbToTRC(rgb, self.trc)
self = <hclsliders.hclsliders.HCLSliders object>
self.updateSyntax = <bound method HCLSliders.updateSyntax of <hclsliders.hclsliders.HCLSliders object>>
rgb = (0.0, 1.0)
trc = 'sRGB'

 /Users/*****/Library/Application Support/krita/pykrita/hclsliders/hclsliders.py in updateSyntax(self=<hclsliders.hclsliders.HCLSliders object>, rgb=(0.0, 1.0), trc='sRGB')
 1599     def updateSyntax(self, rgb: tuple, trc: str):
 1600         if self.notation == NOTATION[0]:
 1601             self.text = Convert.rgbFToHexS(*rgb, trc)
 1602         elif self.notation == NOTATION[1]:
 1603             self.text = Convert.rgbFToOklabS(*rgb, trc)
self = <hclsliders.hclsliders.HCLSliders object>
self.text = '#FFFDFD'
global Convert = <class 'hclsliders.colorconversion.Convert'>
Convert.rgbFToHexS = <function Convert.rgbFToHexS>
rgb = (0.0, 1.0)
trc = 'sRGB'
TypeError: Convert.rgbFToHexS() missing 1 required positional argument: 'trc'
    __cause__ = None
    __class__ = <class 'TypeError'>
    __context__ = None
    __delattr__ = <method-wrapper '__delattr__' of TypeError object>
    __dict__ = {}
    __dir__ = <built-in method __dir__ of TypeError object>
    __doc__ = 'Inappropriate argument type.'
    __eq__ = <method-wrapper '__eq__' of TypeError object>
    __format__ = <built-in method __format__ of TypeError object>
    __ge__ = <method-wrapper '__ge__' of TypeError object>
    __getattribute__ = <method-wrapper '__getattribute__' of TypeError object>
    __gt__ = <method-wrapper '__gt__' of TypeError object>
    __hash__ = <method-wrapper '__hash__' of TypeError object>
    __init__ = <method-wrapper '__init__' of TypeError object>
    __init_subclass__ = <built-in method __init_subclass__ of type object>
    __le__ = <method-wrapper '__le__' of TypeError object>
    __lt__ = <method-wrapper '__lt__' of TypeError object>
    __ne__ = <method-wrapper '__ne__' of TypeError object>
    __new__ = <built-in method __new__ of type object>
    __reduce__ = <built-in method __reduce__ of TypeError object>
    __reduce_ex__ = <built-in method __reduce_ex__ of TypeError object>
    __repr__ = <method-wrapper '__repr__' of TypeError object>
    __setattr__ = <method-wrapper '__setattr__' of TypeError object>
    __setstate__ = <built-in method __setstate__ of TypeError object>
    __sizeof__ = <built-in method __sizeof__ of TypeError object>
    __str__ = <method-wrapper '__str__' of TypeError object>
    __subclasshook__ = <built-in method __subclasshook__ of type object>
    __suppress_context__ = False
    __traceback__ = <traceback object>
    args = ("Convert.rgbFToHexS() missing 1 required positional argument: 'trc'",)
    with_traceback = <built-in method with_traceback of TypeError object>

The above is a description of an error in a Python program.  Here is
the original traceback:

Traceback (most recent call last):
  File "/Users/*****/Library/Application Support/krita/pykrita/hclsliders/hclsliders.py", line 1172, in getKritaColors
    self.updateSyntax(rgb, trc)
  File "/Users/*****/Library/Application Support/krita/pykrita/hclsliders/hclsliders.py", line 1601, in updateSyntax
    self.text = Convert.rgbFToHexS(*rgb, trc)
TypeError: Convert.rgbFToHexS() missing 1 required positional argument: 'trc'
1 Like

thanks for reporting!
this happens because krita opens up the file using grayscale color profile but i haven’t coded any support for it.
will add it in the new version im working on, abit busy currently so please wait awhile for the update.

2 Likes

were can i find 5.3 version?

This is a pre-alpha version, the official 5.3 hasn’t come out yet. But I got one of these in the latest Krita Monthly Update post a few weeks back.

Or you can grab it over at the Krita GitLab site, at the bottom off the page.

You’ll find the unstable versions here, they’re regularly getting updated.