It is currently March 28th, 2024, 6:38 pm

SysColor plugin 2.0.0

Plugins and Addons popular with the Community
User avatar
ikarus1969
Posts: 571
Joined: February 28th, 2011, 3:20 pm
Location: Vienna, Austria

Re: SysColor plugin 1.1

Post by ikarus1969 »

Hi Brian!

i stumbled across a possible bug (i don't say that the bug is on my own coding but maybe you can help me out):

in a skin i retrieve the Aero-color. On an XP-system i still get a color together with the error message in the log that Aero could not be returned on XP. So far so good.

But on XP-systems i want to use another color than the one returned by the plugin, so i made a calc-measure which substitutes a little bit:

Code: Select all

[Measure_Aero_CALC]
Measure=CALC
Formula=Measure_Aero
RegexpSubstitute=1
Substitute="^1$":"[Measure_Aero]","^-1$":"C8D8D820"
But then i noticed that the plugin still returns 1 for Aero on XP systems as the numerical value.
I do that by:

Code: Select all

[Measure_Aero_NUM]
Measure=CALC
Formula=[Measure_Aero:]
DynamicVariables=1
Is it possible to get an -1 in this case? Or is there an error in my coding?
User avatar
Brian
Developer
Posts: 2673
Joined: November 24th, 2011, 1:42 am
Location: Utah

Re: SysColor plugin 1.1

Post by Brian »

ikarus1969 wrote:Is it possible to get an -1 in this case? Or is there an error in my coding?
There is a smallish bug with my plugin that you have found. The default ColorType is "Desktop". So any invalid ColorType will default to the "Desktop" color type. On XP systems, any of the Aero/Win8/DWM color types are invalid, thus defaulting to "Desktop". This is why you get a color for the string value, and a "1" for the number value (along with an error message).

I will work on a fix for this.

-Brian
User avatar
Brian
Developer
Posts: 2673
Joined: November 24th, 2011, 1:42 am
Location: Utah

Re: SysColor plugin 1.1

Post by Brian »

New version here: http://rainmeter.net/forum/viewtopic.php?p=80787#p80787

@ikarus1969: I believe I have fixed the issue. All invalid ColorTypes should now return -1.0 for the number value, and nothing for the string value. So on XP systems, if the ColorType is AERO (or Win8/DWM types), no color should be returned and a -1 should be the number value.

Thanks for reporting the issue!

-Brian
User avatar
ikarus1969
Posts: 571
Joined: February 28th, 2011, 3:20 pm
Location: Vienna, Austria

Re: SysColor plugin 1.1

Post by ikarus1969 »

Brian wrote:Thanks for reporting the issue!

-Brian
Thanks for creating this plugin and the fast response!

Now it works and as a side-effect i can easily detect if a system is Win-Xp or a later edition ;-)
Screenshot - Rainmeter.png
-1 if color-type is invalid
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: SysColor plugin 1.1

Post by jsmorley »

For Windows 10 "accent color", which about the only thing you can really set in Win10...

Gets the accent color, and evaluates the "brightness" of the color to determine if white or black would be used by Windows for the text on title bars, start menu, taskbar etc.

http://www.nbdtech.com/Blog/archive/2008/04/27/Calculating-the-Perceived-Brightness-of-a-Color.aspx

Works fine if you have Windows automatically setting the accent color based on your desktop wallpaper, which I personally would never do, as it is just shockingly ugly about 80% of the time.
Win10AcccentColor_1.0.rmskin
(115.38 KiB) Downloaded 329 times
1.jpg
2.jpg
Requires uhm... Windows 10 to install the .rmskin.

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1

[MeasureTitleBarRGB]
Measure=Plugin
Plugin=SysColor
ColorType=DWM_COLOR
DisplayType=RGB

[MeasureTitleBarRed]
Measure=Plugin
Plugin=SysColor
ColorType=DWM_COLOR
DisplayType=Red

[MeasureTitleBarGreen]
Measure=Plugin
Plugin=SysColor
ColorType=DWM_COLOR
DisplayType=Green

[MeasureTitleBarBlue]
Measure=Plugin
Plugin=SysColor
ColorType=DWM_COLOR
DisplayType=Blue

[MeasureTitleBarLumin]
Measure=Calc
Formula=(([MeasureTitleBarRed] * 299) + ([MeasureTitleBarGreen] * 587) + ([MeasureTitleBarBlue] * 114)) / 1000
IfBelowValue=130
IfBelowAction=[!SetVariable TitleBarTextColor "255,255,255,255"][!UpdateMeter *][!Redraw]
IfAboveValue=129
IfAboveAction=[!SetVariable TitleBarTextColor "0,0,0,255"][!UpdateMeter *][!Redraw]
DynamicVariables=1

[MeterTitleBar]
Meter=Image
W=300
H=36
SolidColor=[MeasureTitleBarRGB]
DynamicVariables=1

[MeterTitleText]
Meter=String
X=10
Y=18
StringAlign=LeftCenter
FontFace=Segoe UI
FontSize=11
FontColor=#TitleBarTextColor#
AntiAlias=1
DynamicVariables=1
InlineSetting=Weight | 100
InlinePattern=.*
Text=Windows Accent Color
------------------
P.S. Don't like the "bag of skittles" color choices that the color-blind 10-year-olds at Microsoft think we want for our desktop? Try this utility to set your own custom accent color.. WinAero.
DollarD
Posts: 16
Joined: March 2nd, 2013, 5:56 pm

Re: SysColor plugin 1.1

Post by DollarD »

Ah, crap. How did I not know about the DWM_COLOR option?

I used a bit more... esoteric... method to get the accent color. This should make it a lot easier.

My solution was this: https://forum.rainmeter.net/viewtopic.php?f=15&t=21303

Sigh. Oh well.
User avatar
Neocooler
Posts: 5
Joined: May 29th, 2020, 4:19 am

Re: SysColor plugin 1.1

Post by Neocooler »

I wanted to use SysColor.dll, but I found myself a bit lost in the construction so
I wanted to help me with an active visual of the activity of this plugin ;-)


Thanks for this one
Attachments
ActifTemplate_SysColor_1.0.rmskin
(118.44 KiB) Downloaded 202 times
User avatar
Brian
Developer
Posts: 2673
Joined: November 24th, 2011, 1:42 am
Location: Utah

Re: SysColor plugin 2.0.0

Post by Brian »

Been a long time coming...

https://forum.rainmeter.net/viewtopic.php?p=80787#p80787

Nothing too spectacular.

ColorType=Accent has been added for Windows 10/11 users.
There is a log message when a new version is available.
ColorType=Accent is now the default over ColorType=Desktop

-Brian
Post Reply