Color changer

Showcase your libraries, tools and other projects that help your fellow love users.
Post Reply
Santos
Party member
Posts: 384
Joined: Sat Oct 22, 2011 7:37 am

Color changer

Post by Santos »

colorchanger.png
colorchanger.png (7.22 KiB) Viewed 1054 times
If you have a game which
  • Stores colors in tables
  • Sets colors in love.draw
  • Runs in a window which leaves enough room on the side of the screen
... then this may possibly work!
  • To use it, try putting something like this at the end of love.load...

    Code: Select all

    require('colorchanger')()
  • You can specify a table to look through (it looks for colors in the global table by default) and/or the key for toggling the color changer (by default it's the tab key), and these can be in either order.

    Code: Select all

    require('colorchanger')('`', colors)
  • The rectangles contain the values for red, green, blue, alpha, hue, saturation and value.
  • Hover over a rectangle and press up/down arrows, or w/s keys, or the scroll wheel to change the values.
  • You can hold the key down to change the value faster, or scroll while holding the left mouse button down.
  • The squares on the left are the "original" color and the "changed" color. Left clicking on either will set the current color to that color, and right clicking will set the other color to that color.
  • The r key or middle click randomises the value/color.
  • The delete key deletes the color from the list if the mouse is over one of its boxes.
  • Changing the grey boxes at the top affect all the colors.
  • A couple of seconds after changing something, the colors are saved to the file colors.lua in the game's save directory.
Attachments
colorchanger.lua
(38.67 KiB) Downloaded 92 times
Post Reply

Who is online

Users browsing this forum: Bing [Bot], Semrush [Bot] and 0 guests