asar icon indicating copy to clipboard operation
asar copied to clipboard

Implemented function to convert RGB colors to RGB555 value

Open furious opened this issue 3 years ago • 3 comments

I've been doing it with custom functions but wanted to make another contribution to Asar.

This PR adds a new builtin function called "rgb555" (sugestion), that you can easily convert colors from hexadecimal rgb555($FF00FF) or like this rgb555(255, 0, 255)

That's it... =)

furious avatar Mar 06 '21 02:03 furious

Coverage Status

Coverage decreased (-0.3%) to 81.578% when pulling 11ebd49c80a4793513b249fa6fbc4a74865e5a70 on furious:feature/rgb555-function into 99d1b729cca874752d1b109314d01343cb754c95 on RPGHacker:master.

coveralls avatar Mar 06 '21 02:03 coveralls

Not a bad idea but I believe this algorithm is wrong. That will need corrected before we can accept. Tests wouldn't hurt either. But I can add those if you don't.

p4plus2 avatar Mar 08 '21 13:03 p4plus2

I've compared with some existing code to compare, feel free to add some tests =)

furious avatar Mar 10 '21 16:03 furious

i don't think this belongs in asar, you can easily implement this yourself as a custom function.

randomdude999 avatar Jan 21 '24 01:01 randomdude999