It is currently March 29th, 2024, 3:56 pm

Plugin: Chameleon

Plugins and Addons popular with the Community
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5384
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Plugin: Chameleon

Post by eclectic-tech »

Thanks raiguard! :thumbup:

Yes, I was seeing the multiple refreshes and lagging, so thanks for letting us know how to implement Chameleon colors in your suite; easier than I thought and I like the additional settings! :D

Have safe travels! Savor and enjoy your experiences! :welcome:
User avatar
y0himba
Posts: 66
Joined: September 25th, 2016, 3:35 pm
Location: At a desk

Re: Plugin: Chameleon

Post by y0himba »

Worked like a charm!
---
Once up a time there was a now playing signature here. Now it is no more. Maybe someone can make a now playing sig gen for Last.fm? :thumbup:
User avatar
100krotka
Posts: 7
Joined: July 30th, 2019, 11:33 am

Re: Plugin: Chameleon

Post by 100krotka »

Hi
I need to detect whether the part of actual screen is light or dark and adjust font color to make it at least readable.
Is it possible using Chameleon?

For me perfect solution would be checking a color under meter (e.g. square under a clock which I have always on screen)
I've read whole topic and didn't find out an answer. :(
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Plugin: Chameleon

Post by jsmorley »

100krotka wrote: October 16th, 2019, 8:01 pm Hi
I need to detect whether the part of actual screen is light or dark and adjust font color to make it at least readable.
Is it possible using Chameleon?

For me perfect solution would be checking a color under meter (e.g. square under a clock which I have always on screen)
I've read whole topic and didn't find out an answer. :(
I do not believe this is possible today.

There are options for the parent measure CropX, CropY, CropW, CropH, which purport to crop the image to only sample the bit of the image or desktop defined by those parameters, but in my testing, I don't think it really works well. First, you can't use any dynamic value for those, like for instance #CURRENTCONFIGX# or #CURRENTCONFIGW#, as that only works the very first time the measure is updated when the skin is loaded, and does not change if those values change, and fails entirely if you refresh the skin. I suspect that the plugin is "caching" the image, and doesn't go back to the well to resample it again unless the image is changed or the plugin is entirely unloaded. Second, as Chameleon is actually always sampling the "image file", even when Type=Desktop, the measurements won't be accurate most of the time, as Windows has resized the image in memory to fit your screen.

Unless Socks The Fox has some thoughts about this, I don't think it can be done.

I will say that this is the one feature that would actually have me using Chameleon much more than I do today, as I am almost always disappointed by the colors it picks. Just the luck of the draw, that where I put my string meter is over a part of the desktop wallpaper that conflicts with what Chameleon picks with its "overall" image sampling.

Now Socks may come back and say "If I completely crop, resample and analyze a 1920 x 1080 image once a second dynamically, you are going to HATE what it does to your CPU". If so, that's fair enough.
User avatar
Socks the Fox
Posts: 104
Joined: August 25th, 2015, 6:40 pm

Re: Plugin: Chameleon

Post by Socks the Fox »

Yeah, at the current time it doesn't do this. I had plans to add it at some point but Windows doesn't offer a good way to get the image data that is actually being used as the background, meaning I'd have to completely re-implement all of the possible scaling/tiling/cropping options from scratch just for the sake of being able to sample a small portion of the resulting image, which is fairly out of the scope of the project I originally intended.

There are still things I want to refine, but I've been struggling a lot lately with motivation to work on projects. Hopefully once I can get the business I'm trying to start going I'll be able to focus on some of these side things.
Author of Chameleon :: Like my plugin? Consider donating! I don't need much :3
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Plugin: Chameleon

Post by jsmorley »

Socks the Fox wrote: October 16th, 2019, 10:38 pm Yeah, at the current time it doesn't do this. I had plans to add it at some point but Windows doesn't offer a good way to get the image data that is actually being used as the background, meaning I'd have to completely re-implement all of the possible scaling/tiling/cropping options from scratch just for the sake of being able to sample a small portion of the resulting image, which is fairly out of the scope of the project I originally intended.

There are still things I want to refine, but I've been struggling a lot lately with motivation to work on projects. Hopefully once I can get the business I'm trying to start going I'll be able to focus on some of these side things.
Understood... As I said above though, I will say that this is the one feature that would actually have me using Chameleon much more than I do today, as I am almost always disappointed by the colors it picks. Just the luck of the draw, that where I put my string meter is over a part of the desktop wallpaper that conflicts with what Chameleon picks with its "overall" image sampling.
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Plugin: Chameleon

Post by jsmorley »

Talking about this:



Works great with the skin here:
1.jpg



Here, not so much...
2.jpg


I think if I could select a particular area of the "image", and then evaluate which of your colors to use based on the "luminance" of the area, I could beat that. The luminance of the overall image can be misleading.
You do not have the required permissions to view the files attached to this post.
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Plugin: Chameleon

Post by jsmorley »

Make no mistake, it's a very, very cool and useful plugin in spite of that.
User avatar
100krotka
Posts: 7
Joined: July 30th, 2019, 11:33 am

Re: Plugin: Chameleon

Post by 100krotka »

Thanks for your answers.

I have same problem as you jsmorley.
My wallpaper is often dark (or dark solid color) and white letters are ok, unless I open browser. White letters on light grey might sometimes be difficult to read. That's why I thought Chameleon could help me.
I am Looking forward for an update and maybe new features.
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Plugin: Chameleon

Post by jsmorley »

I think if the CropX/CropY/CropW/CropH options could be made to function properly when they are changed dynamically, that might be a huge step forward, even if there is still the issue of the resizing of the Windows wallpaper that isn't solved. Some care might need to be taken to ensure that having those options support dynamic changes doesn't cause the plugin to use tons of CPU, but that might be able to be solved by having a !CommandMeasure bang with a parameter of "resample" or something, so the work can be "on demand" and not on every skin update.

In a perfect world you might use:

CropX=#CURRENTCONFIGX#
CropY=#CURRENTCONFIGY#
CropW=#CURRENTCONFIGWIDTH#
CropH=#CURRENTCONFIGHEIGHT#

And the colors would be sampled based on the position and size of the skin.

Even more granularity could be had by combining for instance #CURRENTCONFIGX# with [MeterName:X] to zero in on a particular meter, and not the entire skin.

Again, you might want a Calc measure or measures that use OnChangeAction with those variables, and then [!CommandMeasure PluginParent "resample"] so it only does the work when you move the skin. I would be very hesitant to just do the work in Reload() in the plugin code, as you have to use DynamicVariables=1 with #CURRENTCONFIGX# and such, but that doesn't mean you want the entire process to happen on every single measure update.

This would be at the judgment of Socks of course. Another option is to just use UpdateDivider=-1 on the parent measure, and then have the Calc measures watching the variables just use [!UpdateMeasure PluginParent] to poke it. The downside of that is that the user must "know" and "be sure" to use UpdateDivider=-1 any time they have DynamicVariables=1, or it will run a bit amok...

In either case, the root of the problem right now is that the plugin will NEVER resample the image, unless the image is actually changed, or the plugin is entirely unloaded. No form of "dynamic" seems to work at all. The "Crop..." options seem to work today, but they must be static values.

There would still be the issue that the size of the image file might not be the same as what Windows is displaying on the screen, but until there is some solution for that, assuming there even can be, the answer is to resize your wallpaper file(s) to be the same size as your screen before you use them. If your screen is 1920 x 1080, resize and / or crop the images to be that size. I think having Socks build in everything Windows uses to resize the images to fit your screen based on the various types of Fill/Crop/Stretch options you can set in Windows is a lot to ask.