It is currently March 29th, 2024, 1:45 pm

Rainmeter Color Picker Skin

Share and get help with Plugins and Addons
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Rainmeter Color Picker Skin

Post by jsmorley »

This is a little addon to allow you to pick the average of colors from any 10 x 10 pixel area on the screen, and have that average color written to the [Variables] section of any Rainmeter .ini or .inc file in either R,G,B or Hex format. Rainmeter is then automatically refreshed, and bingo. You have re-colorized your whole suite of skins...

You do the picking with an actual Rainmeter skin, not some hard coded GUI. So this can look like anything you want, use any image as the movable target. Should be very flexible. The AutoIt code for the addon that gets the color and writes to the files is included, so feel free to modify it as you wish, as long as you include credit if you distribute.

Please read the GetUnderColor.ini skin file for instructions on how to use this addon. It is very easy to use, but very hostile to mistakes. Just won't run without the right parameters in the right order.

Here is a .rmskin file with the addon and sample skins to show how you can use it to set a color in a UserVariables.inc file that is used by multiple skins: You MUST be running Rainmeter 1.2 RC1 (r430) or better from [url]htp://Rainmeter.net[/url] to install this .rmskin. The addon will be installed in \Addons\GetUnderColor.
GetUnderColor.rmskin
Here is a little flash example of one way to use it. Everything you see is just Rainmeter skins...

[rainflash]603,473,ftp://jsmorley.serveftp.com/Color.swf[/rainflash]


Note: I decided to go for the "average" color of a 10 x 10 pixel area rather than a straight up "color picker" since without using a hard coded GUI to do the picking, there is no good way to get the "zooming" and "nudging" and all that you really need to pick a single pixel with any accuracy. With this approach you can use any image you want for the "arrow", incorporate this into your skins and suites in clever ways, and you will find that the "average" of any 10 pixel area is normally going to be the color you want, or really close.

You could always put a color wheel or swatches in your skin for a user to choose from...


Image
You do not have the required permissions to view the files attached to this post.
P2C
Posts: 45
Joined: November 13th, 2009, 10:22 pm
Location: near Würzburg, Germany

Re: Rainmeter Color Picker Skin

Post by P2C »

Keep 'em coming :watching:
User avatar
~Faradey~
Posts: 366
Joined: November 12th, 2009, 4:47 pm
Location: Ukraine

Re: Rainmeter Color Picker Skin

Post by ~Faradey~ »

That is awesome!!! :thumbsu: :thumbsu: Great Work :D
User avatar
karmat
Posts: 329
Joined: July 7th, 2009, 11:10 pm
Location: Canada

Re: Rainmeter Color Picker Skin

Post by karmat »

Great idea!
User avatar
brijamelsh
Posts: 47
Joined: July 16th, 2010, 4:24 am

Re: Rainmeter Color Picker Skin

Post by brijamelsh »

As with the Average color rmskin file, I am getting the "error: invalid file" message when I try to install.
User avatar
JpsCrazy
Posts: 667
Joined: April 18th, 2010, 2:16 pm
Location: NY, USA

Re: Rainmeter Color Picker Skin

Post by JpsCrazy »

Looks a little familiar. ;)
Great work making it happen!
User avatar
brijamelsh
Posts: 47
Joined: July 16th, 2010, 4:24 am

Re: Rainmeter Color Picker Skin

Post by brijamelsh »

This file is corrupt, would you be able to update it please?
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Rainmeter Color Picker Skin

Post by jsmorley »

Attachment replaced in first post.
User avatar
brijamelsh
Posts: 47
Joined: July 16th, 2010, 4:24 am

Re: Rainmeter Color Picker Skin

Post by brijamelsh »

thank you sir.
User avatar
brijamelsh
Posts: 47
Joined: July 16th, 2010, 4:24 am

Re: Rainmeter Color Picker Skin

Post by brijamelsh »

Hello again.

So I was able to get this addon to work fairly easily to pick the color and set it in the uservariables.inc

I am trying to expand on it by allowing the user to store "swatches", by selecting a swatch and then using the color picker to set the swatch color. Once the swatch is set, the user can double click the swatch to activate it in the uservariables.inc

What I've tried so far:

Creates Swatch1, Swatch2 etc.. variables in the uservariables.inc
Created ColorPicker variable in GetUnderColor
Set mouse action in Sample.ini to change the ColorPicker value when swatch is clicked

UserVariable.inc

Code: Select all

Swatch1=30, 124, 255
Swatch2=124, 252, 0
Swatch3=255, 255, 0
Swatch4=178, 34, 34
Swatch5=255, 140, 0
GetUnderColor

Code: Select all

[Variables]
;@Include="#CURRENTPATH#Sample\UserVariables.inc"
;IncFile="#CURRENTPATH#Sample\UserVariables.inc"
@include="#SKINSPATH#Enigma\Resources\Variables\UserVariables.inc"
IncFile="#SKINSPATH#Enigma\Resources\Variables\UserVariables.inc"
ColorPicker=#ColorActive#

[ColorTarget]
Meter=Image
ImageName=Arrow.png
GreyScale=1
ImageTint=#ColorPicker#
DynamicVariables=1

[SelectIcon]
Meter=Image
ImageName=Ok.png
X=65
Y=0
LeftMouseUpAction=!Execute ["#ADDONSPATH#GetUnderColor\GetUnderColor.exe" "#ColorPicker#" "GetUnderColor" 
"ColorTarget" "#IncFile#" "0"]
Sample.ini

Code: Select all

[Variables]
@include="#SKINSPATH#Enigma\Resources\Variables\UserVariables.inc"

[MeterSample]
Meter=Image
SolidColor=#ColorActive#
W=10
H=10
X=25
Y=10

[Swatch1]
Meter=Image
SolidColor=#Swatch1#
W=10
H=10
X=15r
Y=r
LeftMouseDownAction= !RainmeterSetVariable ColorPicker Swatch1 GetUnderColor
DynamicVariables=1
So unless Im mistaken, this should change the swatch1 value in the uservariables fial, changing the color that is being displayed for swatch1 in the sample.ini, the problem is that the GetUnderColor is not grabbing any color and is not chaning the variables.