It is currently May 8th, 2024, 2:38 pm

raincolors.lua [1.2.18.03.24]

Skins that control functions in Windows or Rainmeter
User avatar
Yincognito
Rainmeter Sage
Posts: 7209
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: raincolors.lua

Post by Yincognito »

RicardoTM wrote: March 9th, 2024, 9:14 pm Alright, finally released it. Edited first post
Nice result, and a good first dive into Lua! Hopefully it will be of use to both you and others looking for something similar, and add to the abilities of whatever skins will be based on these. :great:

P.S. One minor observation though: when packing a skin, you might consider setting the minimum required Rainmeter version to something lower, so that folks using older versions of Rainmeter can install it too.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
RicardoTM
Posts: 272
Joined: December 28th, 2022, 9:30 pm
Location: México

Re: raincolors.lua

Post by RicardoTM »

Yincognito wrote: March 9th, 2024, 10:57 pm Nice result, and a good first dive into Lua! Hopefully it will be of use to both you and others looking for something similar, and add to the abilities of whatever skins will be based on these. :great:

P.S. One minor observation though: when packing a skin, you might consider setting the minimum required Rainmeter version to something lower, so that folks using older versions of Rainmeter can install it too.
Thanks, it's been quite a trip indeed. A lot of stuff to learn. Hopefully it helps getting nice looking skins and makes it easier to make themes in a quicker way. Which is why I created this, I was having a hard time creating a light theme for my gauges skin, this lib will definitely help making it. It can also be used to let users select one or two colors and all the skin's UI would adapt to that. The adjust contrast function is a very powerful one.

Who uses old versions of Rainmeter? :? jk, I'm not aware of what versions support what so that's why I just don't touch that. If you let me know what is the oldest version that supports most stuff I can use that.
User avatar
Yincognito
Rainmeter Sage
Posts: 7209
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: raincolors.lua

Post by Yincognito »

RicardoTM wrote: March 10th, 2024, 1:55 am Thanks, it's been quite a trip indeed. A lot of stuff to learn. Hopefully it helps getting nice looking skins and makes it easier to make themes in a quicker way. Which is why I created this, I was having a hard time creating a light theme for my gauges skin, this lib will definitely help making it. It can also be used to let users select one or two colors and all the skin's UI would adapt to that. The adjust contrast function is a very powerful one.

Who uses old versions of Rainmeter? :? jk, I'm not aware of what versions support what so that's why I just don't touch that. If you let me know what is the oldest version that supports most stuff I can use that.
Not entirely sure, I guess 4.3 or something. Personally, I always use 3.0 cause I don't like to bother with finding out the version that supported this and that, but that's just me.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
RicardoTM
Posts: 272
Joined: December 28th, 2022, 9:30 pm
Location: México

Re: raincolors.lua

Post by RicardoTM »

Yincognito wrote: March 10th, 2024, 11:54 am Not entirely sure, I guess 4.3 or something. Personally, I always use 3.0 cause I don't like to bother with finding out the version that supported this and that, but that's just me.
Alright, I'll do that.
RicardoTM
Posts: 272
Joined: December 28th, 2022, 9:30 pm
Location: México

raincolors.lua [New Update]

Post by RicardoTM »

New update released, new package on first post.

Changes:
  • Version 1.1.10.03.24
  • Deleted functions saturate(), desaturate(), brighten() and darken()
  • Added functions hue('color',newHue), saturation('color',newSat) and lightness('color',newLight)
    Those functions were doing practically the same as the shift functions, these new functions will fix the hue, saturation or lightness values to a new given value which allows for better control.
  • Renamed colorBrightness() function to brightness()
  • Renamed colorHSL(), colorRGB() and colorHEX() functions to HSL(),RGB() and HEX()
  • Small changes to example skins.
  • Added new Themes example skin.
  • Added support to input HEX colors.
RicardoTM
Posts: 272
Joined: December 28th, 2022, 9:30 pm
Location: México

raincolors.lua [Another Update]

Post by RicardoTM »

Updated to Version1.2.18.03.24. Main post has been updated.

While implementing it on one of my skins, I noticed there are times it would be useful to only get a single value, or use values separated, so I added a Splitting section which includes functions that return a single value. I also renamed some functions that were not self explanatory, also created a new Basic Color Selector example skin to showcase conversion functions. While doing it I noticed little "bugs" that were happening due to returned values being rounded, so I added a round function and now all returns, except for those on color theory and generation sections, return values rounded to 2 decimal places. This allowed for better internal accuracy. Then I decided to improve the themes example skin, I added the tabs functionality and a toggle button that toggles between dark and light version, it now also writes all variables to showcase proper implementation.

ezgif.com-video-to-gif-converter (7).gif
New toggle button.

ezgif.com-video-to-gif-converter (6).gif
New basic color selector example skin.

I would appreciate any observation anyone who has tried it has to share to continue building and improving this library.

Changelog
  • Version1.2.18.03.24
  • Added function round(number, ndp)
  • Now returns are rounded to 2 decimal places for better accuracy.
  • Renamed functions saturation(color, amount), lightness(color, amount) and hue(color, angle) to setSat(color, newSat), setLight(color, newLight) and setHue(color,newHue)
  • Renamed functions RGB(HEX), HEX(color) and HSL(color) to RGB2HSL(color), HSL2RGB(HSL), RGB2HEX(color) and HEX2RGB(HEX)
  • Added functions red(color),green(color),blue(color), h(color), s(color) and l(color) which return a single value.
  • Added BasicColorSelector example skin.
  • Improved Themes example skin.
  • Adapted all other example skins to new changes.
You do not have the required permissions to view the files attached to this post.
User avatar
Yincognito
Rainmeter Sage
Posts: 7209
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: raincolors.lua [1.2.18.03.24]

Post by Yincognito »

Hey, Ricardo, I know I was the one advising you to keep the posted release in the same thread as the subjects were related, but since this has now fully become a release topic, I moved it in the appropriate section, along your other nice utilities. Hope it's OK with you. ;-)
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
RicardoTM
Posts: 272
Joined: December 28th, 2022, 9:30 pm
Location: México

Re: raincolors.lua [1.2.18.03.24]

Post by RicardoTM »

Yincognito wrote: March 18th, 2024, 10:33 am Hey, Ricardo, I know I was the one advising you to keep the posted release in the same thread as the subjects were related, but since this has now fully become a release topic, I moved it in the appropriate section, along your other nice utilities. Hope it's OK with you. ;-)
No problem. I would've preferred to create a new topic as I told you but I'm fine with this. I'd delete all old "unrelated" posts as well if I could.
User avatar
Yincognito
Rainmeter Sage
Posts: 7209
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: raincolors.lua [1.2.18.03.24]

Post by Yincognito »

RicardoTM wrote: March 18th, 2024, 12:14 pm No problem. I would've preferred to create a new topic as I told you but I'm fine with this. I'd delete all old "unrelated" posts as well if I could.
Which "old and unrelated" posts are you referring to? :???:
If they're not too many I guess that wouldn't be a problem, unless the info in them has the potential to help other readers in the future (if that's the case, I'd personally keep them - my opinion).
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
RicardoTM
Posts: 272
Joined: December 28th, 2022, 9:30 pm
Location: México

Re: raincolors.lua [1.2.18.03.24]

Post by RicardoTM »

Yincognito wrote: March 18th, 2024, 12:49 pm Which "old and unrelated" posts are you referring to? :???:
If they're not too many I guess that wouldn't be a problem, unless the info in them has the potential to help other readers in the future (if that's the case, I'd personally keep them - my opinion).
Personally I would delete everything from page 1 to 3. Or at least every post that has nothing relevant in it (including this post). But I think that's too much to ask only for me to "cure" my anxiety (because I deleted the original post and now first answers don't make sense :lol:)


So nah, don't worry about it.