It is currently March 29th, 2024, 1:33 am

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 »

Nice plugin Socks! :thumbup:

Since the alpha will default to 'FF' if not specified, being able to specify the alpha in the child measure (or not including it in the returned value), would be helpful.

Suggestion: Specify the format that is returned by the plugin, either Hex or RGB. My thought is some people prefer working in one or the other formats when defining colors.

The plugin has been returning colors that are complimentary most of the time.
Working very well! :great:

I noticed some "failsafe fallback" to default colors in your code, is there any plan to be able to control these from the measures?

Thanks for this, waiting patiently for any thing you can implement. :Watching:
User avatar
Socks the Fox
Posts: 104
Joined: August 25th, 2015, 6:40 pm

Re: Plugin: Chameleon

Post by Socks the Fox »

I'm probably going to just flat out remove the alpha value from the final color, it's the easiest option and I don't think enough people use my plugin for it to be too big an issue.

I didn't know that non-hex colors was an option, I'm so used to HTML color codes that hex is my default! XD I'll see about adding that as an option as well.

I have a set of attributes that are applied to each color, that the code picks the ones with the highest score for each value depending on the weights of the attributes. After all the colors are picked, it does a simple calculation to make sure the contrast is high enough and if not sets the foreground colors to black or white depending on the background. The weights could always use tweaking to better pick colors but I felt these got it good enough most of the time (seeing as the use case I originally developed this for was desktop backgrounds I felt it didn't have to match iTunes all that much).

I hadn't thought of allowing users to specify the fallback colors, I'll add that to my feature to-do list. I can see that being useful!
Author of Chameleon :: Like my plugin? Consider donating! I don't need much :3
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 »

I am using this strictly with wallpapers... I am leaning toward your plugin because it returns 4 values (versus 3 in ColorExtract) and seems to provide colors closer to the current wallpaper.

I can work around all of my suggestions; using RegExpSubstitute to only return the first 6 values, and a lua script to convert Hex to RGB.

The plugin does a pretty good job in selecting contrasting colors, so implementing a user option may not be necessary.

Thanks again...
This helps me realize an idea I had several years ago and never was able to fully implement. :rosegift:
User avatar
Socks the Fox
Posts: 104
Joined: August 25th, 2015, 6:40 pm

Re: Plugin: Chameleon

Post by Socks the Fox »

I was already kind of planning to drop the alpha channel from the returned colors because I figured it would be a useful thing.

Offering numeric results instead of hex isn't all that hard, I already use Boost so lexical_cast and concatinating makes that easy.

User fallback I'm adding because with my example album-art sampling skin when a track doesn't have AA the black and white is a bit jarring and I might be able to set it to use the desktop colors instead.

I'll probably work on these when I get out of work tomorrow.

I'll be honest I didn't know ColorExtract even existed when I wrote this XD As can be seen by my posts here so far I haven't been very attentive. Although, looking at it it doesn't automatically grab the desktop background, one has to manually specify what image to use.

I don't know about the performance of CE but profiling my library I've found that extracting the image data from the file tends to be the most expensive operation, the 64 bit release build resizes and samples a 14k x 10k image in less than a millisecond (the 32 bit one takes roughly 4ms). It'd be awesome to figure out a way to get image data from a playing video, it certainly seems to be able to handle it. I specifically designed things so that the core sampling code is it's own library, so if anyone wants to use it for their own thing they can do so without too much fuss.
Author of Chameleon :: Like my plugin? Consider donating! I don't need much :3
User avatar
Socks the Fox
Posts: 104
Joined: August 25th, 2015, 6:40 pm

Re: Plugin: Chameleon

Post by Socks the Fox »

Alrighty! I've updated Chameleon to v1.1! You can download it from the same link as in the OP. This time the plugin DLLs are included in the example .rmskin file, and the example skin has been updated a bit to touch on some of the new features (mainly the AlbumArt variation of the Media skin now uses the fallback values to default to the desktop colors when a song doesn't have album art).
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 »

Might want to mention in your docs that the option to control Hex and Dec output is the Format option:

Format=Hex (default)
Format=Dec

This is a very spiffy little plugin. I'm impressed.
User avatar
Socks the Fox
Posts: 104
Joined: August 25th, 2015, 6:40 pm

Re: Plugin: Chameleon

Post by Socks the Fox »

Whoops! I clarified that a bit (though could probably still do better). I am terrible at writing documentation, especially for end user use XD

Thank you :3 my #1 goal was to write something I would find useful, and hoped that others would use too.
Author of Chameleon :: Like my plugin? Consider donating! I don't need much :3
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 for the updates!

The first release included the x64 & x86 dll's to use in distribution with skins...
The zip file I downloaded from your site tonight, only has the demo skin and read me files.

Can you add them to the download?

Thanks again!
User avatar
Socks the Fox
Posts: 104
Joined: August 25th, 2015, 6:40 pm

Re: Plugin: Chameleon

Post by Socks the Fox »

The plugin is in the demo skin, by request of the Rainmeter developers. Installing the demo skin should let you use the plugin in your own skins as well.
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 »

The standard way most folks do 3rd-party plugins is to put the 32bit and 64bit versions of the .dll files in the @Resources folder of the "example" skin. Like:

..Skins\ActionTimer\@Resources\ActionTimer for Redistribution\32bit\ActionTimer.dll
..Skins\ActionTimer\@Resources\ActionTimer for Redistribution\32bit\ActionTimer.dll

Then also add the 32bit and 64bit versions to the .rmskin when you create that.

The ones in @Resources are not used by the .rmskin, or by the skin when it is installed, but are for users to have both architecture versions of your plugin available for when they create and distribute their own .rmskins.