In this skin, I only use 4 colors (Foreground 1, 2, and Background 1, 2). The Light and Dark colors are repeats anyway and not useful in my opinion.
The problem I have with this is that whenever the wallpaper change, the new colors don't get updated, instead it still shows colors from the previous wallpaper. The picture I've added below shows the first 4 squares representing the current wallpaper's colors, and the 4 squares below SHOULD show the swapped colors (or not swapped, depending on brightness values):
This is what should happen:
But as you can see, the second row of 4 squares are not updating as expected. What I did try is add DynamicVariables to each of the chameleon measures (PreFG1, PreFG2, PreBG1 and PreBG2) and also add a force update of the measures that does the color swapping whenever they change but that doesn't seem to help. However, if I do a manual refresh, the swapping occurs.
Any help is appreciated.
Here's the code for the included file that does all the color swapping:
Code: Select all
--------------------------------------------------------------------------------------
; VARIABLES
--------------------------------------------------------------------------------------
[Variables]
; This will be populated with measures below once comparisons are done
FG1=""
FG2=""
BG1=""
BG2=""
--------------------------------------------------------------------------------------
; PRIMARY MEASURES
--------------------------------------------------------------------------------------
[ChameleonDesktop]
Measure=Plugin
Plugin=Chameleon
Type=Desktop
; Comment out Crop lines to disable color sampling under skin and instead use the entire wallpaper.
;CropX=#CURRENTCONFIGX#
;CropY=#CURRENTCONFIGY#
;CropW=#CURRENTCONFIGWIDTH#
;CropH=#CURRENTCONFIGHEIGHT#
ContextAwareColors=0
DynamicVariables=1
[PreFG1]
Measure=Plugin
Plugin=Chameleon
Parent=ChameleonDesktop
Color=Foreground1
Format=Dec
OnChangeAction=[!UpdateMeasureGroup SwapColors]
DynamicVariables=1
[PreFG2]
Measure=Plugin
Plugin=Chameleon
Parent=ChameleonDesktop
Color=Foreground2
Format=Dec
OnChangeAction=[!UpdateMeasureGroup SwapColors]
DynamicVariables=1
[PreBG1]
Measure=Plugin
Plugin=Chameleon
Parent=ChameleonDesktop
Color=Background1
Format=Dec
OnChangeAction=[!UpdateMeasureGroup SwapColors]
DynamicVariables=1
[PreBG2]
Measure=Plugin
Plugin=Chameleon
Parent=ChameleonDesktop
Color=Background2
Format=Dec
OnChangeAction=[!UpdateMeasureGroup SwapColors]
DynamicVariables=1
--------------------------------------------------------------------------------------
; PRE SWAP COLOR VALUE MEASURES
--------------------------------------------------------------------------------------
; Pre FG1
[MeasureRedPreFG1]
Measure=String
String=[PreFG1]
RegExpSubstitute=1
Substitute="^(\d{1,}),(\d{1,}),(\d{1,})":"\1"
DynamicVariables=1
[MeasureGreenPreFG1]
Measure=String
String=[PreFG1]
RegExpSubstitute=1
Substitute="^(\d{1,}),(\d{1,}),(\d{1,})":"\2"
DynamicVariables=1
[MeasureBluePreFG1]
Measure=String
String=[PreFG1]
RegExpSubstitute=1
Substitute="^(\d{1,}),(\d{1,}),(\d{1,})":"\3"
DynamicVariables=1
; Pre FG2
[MeasureRedPreFG2]
Measure=String
String=[PreFG2]
RegExpSubstitute=1
Substitute="^(\d{1,}),(\d{1,}),(\d{1,})":"\1"
DynamicVariables=1
[MeasureGreenPreFG2]
Measure=String
String=[PreFG2]
RegExpSubstitute=1
Substitute="^(\d{1,}),(\d{1,}),(\d{1,})":"\2"
DynamicVariables=1
[MeasureBluePreFG2]
Measure=String
String=[PreFG2]
RegExpSubstitute=1
Substitute="^(\d{1,}),(\d{1,}),(\d{1,})":"\3"
DynamicVariables=1
; Pre BG1
[MeasureRedPreBG1]
Measure=String
String=[PreBG1]
RegExpSubstitute=1
Substitute="^(\d{1,}),(\d{1,}),(\d{1,})":"\1"
DynamicVariables=1
[MeasureGreenPreBG1]
Measure=String
String=[PreBG1]
RegExpSubstitute=1
Substitute="^(\d{1,}),(\d{1,}),(\d{1,})":"\2"
DynamicVariables=1
[MeasureBluePreBG1]
Measure=String
String=[PreBG1]
RegExpSubstitute=1
Substitute="^(\d{1,}),(\d{1,}),(\d{1,})":"\3"
DynamicVariables=1
; Pre BG2
[MeasureRedPreBG2]
Measure=String
String=[PreBG2]
RegExpSubstitute=1
Substitute="^(\d{1,}),(\d{1,}),(\d{1,})":"\1"
DynamicVariables=1
[MeasureGreenPreBG2]
Measure=String
String=[PreBG2]
RegExpSubstitute=1
Substitute="^(\d{1,}),(\d{1,}),(\d{1,})":"\2"
DynamicVariables=1
[MeasureBluePreBG2]
Measure=String
String=[PreBG2]
RegExpSubstitute=1
Substitute="^(\d{1,}),(\d{1,}),(\d{1,})":"\3"
DynamicVariables=1
--------------------------------------------------------------------------------------
; PRE SWAP COLOR TOTAL MEASURES
--------------------------------------------------------------------------------------
[MeasureColorPreFG1]
Measure=Calc
Formula=( [MeasureRedPreFG1] + [MeasureGreenPreFG1] + [MeasureBluePreFG1] )
DynamicVariables=1
[MeasureColorPreFG2]
Measure=Calc
Formula=( [MeasureRedPreFG2] + [MeasureGreenPreFG2] + [MeasureBluePreFG2] )
DynamicVariables=1
[MeasureColorPreBG1]
Measure=Calc
Formula=( [MeasureRedPreBG1] + [MeasureGreenPreBG1] + [MeasureBluePreBG1] )
DynamicVariables=1
[MeasureColorPreBG2]
Measure=Calc
Formula=( [MeasureRedPreBG2] + [MeasureGreenPreBG2] + [MeasureBluePreBG2] )
DynamicVariables=1
--------------------------------------------------------------------------------------
; SWAP MEASURES
--------------------------------------------------------------------------------------
[MeasureSwapFG1withBG1]
Measure=Calc
IfCondition=MeasureColorPreFG1>MeasureColorPreBG1
IfTrueAction=[!SetVariable "FG1" "[PreFG1]"][!SetVariable "BG1" "[PreBG1]"]
IfFalseAction=[!SetVariable "FG1" "[PreBG1]"][!SetVariable "BG1" "[PreFG1]"]
Group=SwapColors
DynamicVariables=1
[MeasureSwapFG2withBG2]
Measure=Calc
IfCondition=MeasureColorPreFG2>MeasureColorPreBG2
IfTrueAction=[!SetVariable "FG2" "[PreFG2]"][!SetVariable "BG2" "[PreBG2]"]
IfFalseAction=[!SetVariable "FG2" "[PreBG2]"][!SetVariable "BG2" "[PreFG2]"]
Group=SwapColors
DynamicVariables=1
--------------------------------------------------------------------------------------
; SET VALUES MEASURES
--------------------------------------------------------------------------------------
[ChamFG1]
Measure=String
String=#FG1#
Group=SwapColors
DynamicVariables=1
[ChamFG2]
Measure=String
String=#FG2#
Group=SwapColors
DynamicVariables=1
[ChamBG1]
Measure=String
String=#BG1#
Group=SwapColors
DynamicVariables=1
[ChamBG2]
Measure=String
String=#BG2#
Group=SwapColors
DynamicVariables=1