Fixing color 'issues' brought in by 11.0
Posted: Fri May 11, 2018 9:00 am
So, while trying my game in the latest version of love2d there's some color 'issues' caused by the latest version due to the fact I'm still using values from 0-255.
At first I thought it would be easy, just adding /255 to each love.setColor call. And then I remembered I have a huge dictionary filled with 'material design' colors. Obviously, adding /255 manually is too much of a hassle.
Here's the dictionary
One of the ways I thought of fixing this is with notepads regex functionality and just use a regex expression to find all the hexadecimal values and add /255 next to them. Sadly, I have no idea how to do that. I've found some regex expressions for finding hexadecimal values but I have no idea how to make it so I can add /255 to the end of each of them.
Any help would be appreciated!
At first I thought it would be easy, just adding /255 to each love.setColor call. And then I remembered I have a huge dictionary filled with 'material design' colors. Obviously, adding /255 manually is too much of a hassle.
Here's the dictionary
One of the ways I thought of fixing this is with notepads regex functionality and just use a regex expression to find all the hexadecimal values and add /255 next to them. Sadly, I have no idea how to do that. I've found some regex expressions for finding hexadecimal values but I have no idea how to make it so I can add /255 to the end of each of them.
Any help would be appreciated!