It is currently June 18th, 2024, 2:26 pm

HSLiders | Color Selector

Skins that control functions in Windows or Rainmeter
RicardoTM
Posts: 290
Joined: December 28th, 2022, 9:30 pm
Location: México

HSLiders | Color Selector

Post by RicardoTM »

-------- HSLiders Classic--------
by RicardoTM and Yincognito
Deprecated: Newer Version here: https://forum.rainmeter.net/viewtopic.php?p=223053#p223052
Jim Foley, Author of "Computer Graphics : Principles and Practice wrote:"RGB is completely useless as a color specification for real people. Almost anything is better; certainly HSL is better."
Ben Shneiderman, Author of "Designing the User Interface : Strategies for Effective Human-Computer Interaction wrote: "The annoying RGB notation is troubling to many users and certainly error prone. I encourage you to adopt a more human-centered solution and HSL seems to be the only candidate for now. The W3C campaign for universal access would be undermined by adoption of only RGB."
What started as a rework of the RGBCode skin I use on my ResizableGauges skin, became an experiment on Color Models and the challenge of doing it using only Rainmeter. No images, libraries nor scripting, pure math.
After a lot of research and experimentation, Yincognito and I got to this result:

HSLiders.jpg
The design is inspired on RGBCode skin and HSLPicker website.

You can either drag, scroll, or input HSL or RGB values directly to select a color, then you can copy the color code on RGB or HEX format.
You can also save up to 30 color swatches. Neat, right?.
Why HSL? Because I like it, that's it. You can select any color and then find different shades and tones pretty quickly.
Hex output is quite useful when working on Photoshop, Illustrator or any other software, even Rainmeter, you just copy the code and paste it wherever you need to.

HSLIders1.gif
While not the most simple skin code-wise (700+ lines), it gets the job done quite nicely.

Although it was designed mainly as an standalone tool, it can be perfectly implemented on other skins, all colors (including swatches) are stored on a separated .inc file.

How it works:
RGB2HSL and HSL2RGB color space conversions (1), RGB2HEX conversion (2), as well as POS2VAL and VAL2POS circular dragging conversions (3) made by Yincognito:

(1) The OfRGB and OfHSL, aka "FromRGB" and "FromHSL" measures use the color space conversion formulas for the corresponding intervals to get the other color space attributes, when the current color space attributes are changed.

(2) The RGB2HEX measure is using addition and multiplication in the base conversion formulas to store the decimal representations of the hexadecimal digits in a decimal number, whose string is then substituted into the proper hexadecimal form (where 10 is A, 11 is B, and so on).

(3) The MOUSE plugin measure retrieves the X and Y of the mouse pointer and calculates the two argument arctangent angle representing the POSition of the mouse in relation to the center of the circle or rotation. It also subsequently converts that angle into suited intervals and directions to get the VALue of H, S, L or R, G and B corresponding to it on the circular shape, taking into account the excluded arc on which dragging is not permitted. Then, in the Shape meter, the ratios of the said VALues of R, G or B to their maximums, in relation to the starting and rotation angles, are used with the trigonometric functions to display the dragging marker in the proper POSition on the circular shape.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
CONTROLS
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

HSL:
Mouse Dragging | Scrolling | Right click to input new value | Double click to reset.

RGB:
Mouse Dragging | Scrolling | Left click on value to input new value.

Copy Color Code to Clipboard:
Click on either RGB or HEX.

Color Swatches:
Click on "▼" to open swatches tab.
Right click on a swatch to set swatch to current color.
Left click to set current color to swatch.
Scroll wheel click to delete.
Click on "▲" to close swatches tab.

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Package
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
This version is deprecated
Newer version on the post below.
HSLiders_1.0.rmskin
Enjoy it

Happy New Year.
You do not have the required permissions to view the files attached to this post.
Last edited by RicardoTM on April 14th, 2024, 3:35 am, edited 4 times in total.
RicardoTM
Posts: 290
Joined: December 28th, 2022, 9:30 pm
Location: México

HSLiders STA v1.0 | Independent Tool

Post by RicardoTM »

--- HSLidersSTA ---
STand Alone
Designed as an Independent Tool
Since my "skinning" skills have increased, I decided to re-make HSLiders from the ground up to make it work with raincolors.lua. I wanted to make it the most compact I could, without sacrificing features, with the only one missing being the swatches (for now, might come in a future patch). Don't worry there are new features, it can generate complementary colors and includes a pretty eyedropper.



This is the STA version, designed to be used as an independent tool.
HSLidersSTA_1.0.13.04.24.rmskin
On the post below you'll find the STD version, which was designed to be implemented on other skins.

Right click on swatch to open color manipulation menu.
Press scroll wheel on the swatch to copy the color, Left click to paste it.
ezgif.com-video-to-gif-converter (10).gif
Click on Scale icon to change its size and aspect ratio.
Scroll on the top part to resize.
dAsset 8d.jpg
Press scroll wheel to open color manipulation menu.
The Eyedropper copies the color automatically.
Untitled2-ezgif.com-video-to-gif-converter.gif
It includes all Adobe color themes, Windows 10 and 11 and 3 extra user themes.
dAsset 9b.jpg
dAsset 10c.jpg
  • Plugins used:
  • Cursor Color v1.3.0.0 by jsmorley
  • HotKey v1.0.0.12 by Brian
  • Mouse v3.2.0 by NighthawkSLO
  • PluginClipboard v1.0.0 by Evgenii

    Scripts used:
  • NirCmd.exe v2.86 by NirSoft
  • raincolors.lua v1.3 by RicardoTM
  • Eyedropper.lua by raiguard
*Known bugs:
The paste icon on the swatch won't show on first mouse over.
Changelog:
13/04/2024 - v1.0 Released
You do not have the required permissions to view the files attached to this post.
Last edited by RicardoTM on April 16th, 2024, 10:35 pm, edited 10 times in total.
RicardoTM
Posts: 290
Joined: December 28th, 2022, 9:30 pm
Location: México

HSLidersSTD v1.0 | For implementation

Post by RicardoTM »

--- HSLidersSTD ---
STandarD
Designed to be implemented on other skins

This version can be easily implemented on other skins. It retains almost all STA version functions, except it can't be minimized, no themes, it has a write icon, and has file structure differences.

The package includes a Dynamic Example skin.
HSLidersSTD_1.0.rmskin
ezgif.com-video-to-gif-converter (12).gif
Remember you have to include these plugins on your packages to distribute your skins:
  • Plugins used:
  • Cursor Color v1.3.0.0 by jsmorley
  • HotKey v1.0.0.12 by Brian
  • Mouse v3.2.0 by NighthawkSLO
  • PluginClipboard v1.0.0 by Evgenii

    Scripts used:
  • NirCmd.exe v2.86 by NirSoft
  • raincolors.lua v1.3 by RicardoTM
  • Eyedropper.lua by raiguard
How to implement:
Copy HSLidersSTD folder and paste it on your skin's root folder.
Copy @Resoruces\Fonts folder and paste it on your skin's @Resources folder.
Follow instructions inside Example.ini and HSLiders.ini
Changelog:
15/04/2024 - v1.0 Released
You do not have the required permissions to view the files attached to this post.
Last edited by RicardoTM on April 16th, 2024, 7:08 am, edited 7 times in total.
RicardoTM
Posts: 290
Joined: December 28th, 2022, 9:30 pm
Location: México

Re: HSLiders | Color Selector

Post by RicardoTM »

Update:HSLidersSTA v1.0 has been released, package on this post.
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5436
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: HSLiders | Color Selector

Post by eclectic-tech »

Very nice work! :thumbup:

Thanks for sharing! :rosegift:
RicardoTM
Posts: 290
Joined: December 28th, 2022, 9:30 pm
Location: México

Re: HSLiders | Color Selector

Post by RicardoTM »

eclectic-tech wrote: April 14th, 2024, 2:30 am Very nice work! :thumbup:

Thanks for sharing! :rosegift:
Thanks for trying it, I'm glad you liked it :bow:
RicardoTM
Posts: 290
Joined: December 28th, 2022, 9:30 pm
Location: México

Re: HSLiders | Color Selector

Post by RicardoTM »

Update:HSLidersSTD v1.0 has been released, package on this post.