It is currently May 26th, 2020, 8:47 pm

Plugin: Chameleon

Plugins and Addons popular with the Community
ms310
Posts: 195
Joined: April 1st, 2015, 7:16 am

Re: Plugin: Chameleon

Post by ms310 »

For me this works as long as the W and H don't go off screen.

Code: Select all

[ChameleonDesktop]
Measure=Plugin
Plugin=Chameleon
Type=Desktop
CropX=#CURRENTCONFIGX#
CropY=#CURRENTCONFIGY#
CropW=360
CropH=100
ContextAwareColors=1
DynamicVariables=1
Disabled=1
My windows version is: Windows 10 Enterprise Version 1809 )OS Build 17763.1098).
User avatar
Cariboudjan
Posts: 78
Joined: May 12th, 2019, 8:55 am

Re: Plugin: Chameleon

Post by Cariboudjan »

Cariboudjan wrote:
March 15th, 2020, 7:16 pm
Actually with that specific bug, the problem seems to have been resolved by updating Windows. Currently using Windows 10 1903.
Scratch this statement. It seems to work 100% on Windows 10, but on Windows 7 the colors will randomly decide to not change on wallpaper change.
Tarimaru
Posts: 3
Joined: April 1st, 2020, 9:10 am

Re: Plugin: Chameleon

Post by Tarimaru »

Hi,

Could someone explain to me what I´m missing or if it is even possible. I want the skin to pick a color based on the specific location of the skin and the size.
But i just get the Error: Chameleon: Could not get handle on C:\Users\[My User Name]\OneDrive\Documents\Rainmeter\Skins\Ajax\ColorPicker\0.

Code: Select all

[Rainmeter]
Update=10
Group=Ajax_Color
DynamicVariables=1

[Variables]
@includeVariables=#@#Color.inc
CP1=[L1CP]

[Wallpaper]
Measure=Registry
RegHKey=HKEY_CURRENT_USER
RegKey=Control Panel\Desktop
RegValue=WallPaper

[MeterPicker1]
Meter=String
Text=#CURRENTCONFIGX#
DynamicVariables=1
W=50
H=50
SolidColor=#CP1#
MiddleMouseUpAction=[!WriteKeyValue Variables CustomColor [AverageCP] "#@#Color.inc"][!RefreshGroup Ajax_Color]
LeftMouseUpAction=[!WriteKeyValue ParentChameleonCP CropX "#CURRENTCONFIGX#"][!WriteKeyValue ParentChameleonCP CropY "#CURRENTCONFIGY#"][!Refresh]

[ParentChameleonCP]
Measure=Plugin
Plugin=Chameleon
Type=File
Path=[Wallpaper]
CropDesktop=1
CropX=1032
CropY=87
CropW=50
CropH=50

[D1CP]
Measure=Plugin
Plugin=Chameleon
Parent=ParentChameleon
Format=Dec
Color=Dark1

[D2CP]
Measure=Plugin
Plugin=Chameleon
Parent=ParentChameleon
Format=Dec
Color=Dark2

[L1CP]
Measure=Plugin
Plugin=Chameleon
Parent=ParentChameleon
Format=Dec
Color=Dark4

[L2CP]
Measure=Plugin
Plugin=Chameleon
Parent=ParentChameleon
Format=Dec
Color=Dark3

[AverageCP]
Measure=Plugin
Plugin=Chameleon
Parent=ParentChameleon
Format=Dec
Color=Average

[BG1CP]
Measure=Plugin
Plugin=Chameleon
Parent=ParentChameleon
Format=Dec
Color=Background1

[BG2CP]
Measure=Plugin
Plugin=Chameleon
Parent=ParentChameleon
Format=Dec
Color=Background2

[FG1CP]
Measure=Plugin
Plugin=Chameleon
Parent=ParentChameleon
Format=Dec
Color=Foreground1

[FG2CP]
Measure=Plugin
Plugin=Chameleon
Parent=ParentChameleon
Format=Dec
Color=Foreground2
mak_kawa
Posts: 642
Joined: December 30th, 2015, 9:47 am

Re: Plugin: Chameleon

Post by mak_kawa »

Hi Tarimaru

Your code causes fatal error for my Rainmeter and it is instantly crashed and disappears.:-) Furthermore, I have not Color.inc file. So, I couldn't examine your code actualy. But, several things I have noticed are;

1. DynamicVariables=1 is not supported in [Rainmeter] section. See here.

2. So, DynamicVaribales=1 seems to be needed at least in [ParentChameleonCP] (and [Wallpaper]?) measure(s).

3. Dynamic variables are not supported also in [Variables] section. See here. So, I am not sure CP1=[L1CP] works or not.

Sorry if I am wrong...
User avatar
eclectic-tech
Rainmeter Sage
Posts: 3933
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Plugin: Chameleon

Post by eclectic-tech »

Tarimaru wrote:
May 9th, 2020, 7:17 pm
Hi,

Could someone explain to me what I´m missing or if it is even possible. I want the skin to pick a color based on the specific location of the skin and the size.
But i just get the Error: Chameleon: Could not get handle on C:\Users\[My User Name]\OneDrive\Documents\Rainmeter\Skins\Ajax\ColorPicker\0.
You name the Chameleon parent measure [ParentChameleonCP], but in all your Chameleon child measures, you refer to it as Parent=ParentChameleon, that is why this code is crashing Rainmeter.

Change the measure name to [ParentChameleon] and change 'ParentChameleonCP' in the !WriteKeyValues of the LeftMouseUpAction in [MeterPicker1] section to 'ParentChameleon'.

The skin will now show the average color for the cropped area when you left-click and write that value to the color.inc file when you middle-click.

EDIT: You do not need skin Update=10 in the [Rainmeter] section. In fact, 'Update=16' is the fastest update available. The default value of 1000 should work fine for this skin.
Tarimaru
Posts: 3
Joined: April 1st, 2020, 9:10 am

Re: Plugin: Chameleon

Post by Tarimaru »

Now it works, Thanks. The wrong name of the ParentMeasure was the issue. It´s always the little things. :handtohead: