It is currently September 26th, 2022, 9:16 am

Aero Color

Get help with creating, editing & fixing problems with skins
dr_infernoo
Posts: 17
Joined: August 29th, 2012, 5:41 am

Aero Color

Post by dr_infernoo »

I was just wondering, is there a way to make a skin grab the color scheme from Windows Aero, the way Windows 8 or AeroRainbow does? I was hoping I can use the effect in one of my skins :)
User avatar
moshi
Posts: 1740
Joined: November 13th, 2012, 9:53 pm

Re: Aero Color

Post by moshi »

you could use this plugin:
http://rainmeter.net/forum/viewtopic.php?f=18&t=14202

if it does not do what you want:
- do a Google search for where in the registry the values you are looking for are stored.
- use a registry measure: http://docs.rainmeter.net/manual/measures/registry
prince1142003
Posts: 56
Joined: December 27th, 2011, 12:32 pm

Re: Aero Color

Post by prince1142003 »

Use a registry measure to read

HKEY_CURRENT_USER\Software\Microsoft\Windows\DWM\ColorizationColor

Value is in AARRGGBB format. Unfortunately, Rainmeter uses RRGGBBAA for colors, so you'll have to somehow convert the values.
User avatar
Seahorse
Posts: 1175
Joined: June 9th, 2010, 5:56 pm
Location: Locks heath, UK

Re: Aero Color

Post by Seahorse »

A Calc with Trunc and Frac can do this for you. Something like this - you might need to check my maths :vomit:

First one discards numbers to the right after the first two digits, the second divides and keeps the remaining numbers...

Code: Select all

[CalcAlpha]
Measure=Calc
Formula=Trunc(MeasureColorizationColor/100)

[CalcRGB]
Measure=Calc
Formula=Frac(MeasureColorizationColor/100)*100
"Regrettably your planet is one of those scheduled for demolition"
Mike

My Skins at DeviantArt

prince1142003
Posts: 56
Joined: December 27th, 2011, 12:32 pm

Re: Aero Color

Post by prince1142003 »

Seahorse wrote:A Calc with Trunc and Frac can do this for you. Something like this - you might need to check my maths :vomit:

First one discards numbers to the right after the first two digits, the second divides and keeps the remaining numbers...

Code: Select all

[CalcAlpha]
Measure=Calc
Formula=Trunc(MeasureColorizationColor/100)

[CalcRGB]
Measure=Calc
Formula=Frac(MeasureColorizationColor/100)*100
I'm not sure that'll work since the registry key returns Hex values that include letters.
User avatar
Mr.Sadistic
Posts: 65
Joined: January 31st, 2013, 5:28 pm

Re: Aero Color

Post by Mr.Sadistic »

How about?

Code: Select all

RegExpSubstitute=1
Substitute="^(\d)(\d)(\d)(\d)(\d)(\d)(\d)(\d)$":"2\3\4\5\6\7\0\1"
User avatar
Brian
Developer
Posts: 2508
Joined: November 24th, 2011, 1:42 am
Location: Utah

Re: Aero Color

Post by Brian »

I don't think any of the above will convert a ARGB to a RGBA. What is really needed is a shift-left(<<) and shift-right(>>) operators (which are an undocumented feature of the Calc measure), but it doesn't work well since the Calc measure uses floating-point arithmetic (we would need unsigned integer arithmetic).

So, to solve the problem, I think the best solution would be to do a little Lua script to convert it. (This is a modified version of the color snippet.)

Code: Select all

function ARGBtoRGBA(color)
    local rgba = { }

    for hex in color:gmatch('..') do
        table.insert(rgba, tonumber(hex, 16))
    end

    -- move the first element (alpha) to the end of the table
    rgba[1], rgba[2], rgba[3], rgba[4] = rgba[2], rgba[3], rgba[4], rgba[1]

    return table.concat(rgba, ',')
end
Note: This also converts the Hex values to decimal values and separates them with a comma.

-Brian
User avatar
AlC
Posts: 329
Joined: June 9th, 2011, 6:46 pm

Re: Aero Color

Post by AlC »

I had the same problem.

So you can try Brian's lua script or you take a look of jsmorley's lua script here.
But why use a lua script if you can use Brian's great SysColor Plugin.
Rainmeter - You are only limited by your imagination and creativity.
User avatar
Brian
Developer
Posts: 2508
Joined: November 24th, 2011, 1:42 am
Location: Utah

Re: Aero Color

Post by Brian »

HA! I remember that thread, but I couldn't find it. I would be inclined to use jsmorely's script over mine as he is much better Lua scripter than I am, plus that is a more complete example.

[ShamlessPlug]Over course there is my plugin.....[/ShamlessPlug] :D

-Brian