Page 1 of 2
a simple color picker
Posted: Mon Jul 06, 2015 10:01 am
by Alexar
hi everyone,
i wrote a in game color picker for my project. and i am grad to share it. all suggestions are welcomed.
- screenshot.png (41.2 KiB) Viewed 8143 times
new version comes up. i used @qubodup's ui.
now you can hold your mouse freely and no need to worry about losting focus to the picker.
Re: a simple color picker
Posted: Mon Jul 06, 2015 10:36 am
by Muzz
Cool!
I might have a use for this straight away!
Just a question why are you calculating the rgb with decimal accuracy? 8 bit images only have a precision of 255 per channel. one major usability function i would suggest is to start the picking on the down click, but keep it as a bool that isn't reset until the user unclicks regardless of if the players mouse is over the top of the picker or not. It is super annoying to have the thing stop because it's hard to keep the mouse on the ring exactly.
Also, why does the value and saturation change when you click on the hue ring? that should be locked and not change until you set that manually.
Re: a simple color picker
Posted: Mon Jul 06, 2015 8:51 pm
by qubodup
Very nice! I hope some games will use it.
Issues
- missing terms of use (I recommend zlib/libpng license or cc0/public domain)
- using outer ring returns floating point numbers at times (I math.floor'ed them in the demo).
- it seems impossible to pick full saturation/black/white because the triangle touches the circle.
- scaled up, the circle is split (which looks cool though)
I made a prettier demo. My changes are cc0/public domain (no need to mention) but consider the font license info - it seems cc0/public domain like but I recommend including the text file.
http://youtu.be/0uAnn3_-Wwc
Re: a simple color picker
Posted: Tue Jul 07, 2015 12:31 am
by MicroMacro
I was wondering if I could use either of your color pickers in a project of mine? I don't know exactly what this project is yet, but I can see it being very useful. All credit will be given.
Re: a simple color picker
Posted: Tue Jul 07, 2015 12:35 am
by Alexar
Muzz wrote:Cool!
I might have a use for this straight away!
Just a question why are you calculating the rgb with decimal accuracy? 8 bit images only have a precision of 255 per channel. one major usability function i would suggest is to start the picking on the down click, but keep it as a bool that isn't reset until the user unclicks regardless of if the players mouse is over the top of the picker or not. It is super annoying to have the thing stop because it's hard to keep the mouse on the ring exactly.
Also, why does the value and saturation change when you click on the hue ring? that should be locked and not change until you set that manually.
thanks man, because results of the convertion from HSV to RGB is not in integer, i passed it directely. i'ill math.floor() the returns.
for the position in the triangle....ok, i ll set it to the same relative position.
Re: a simple color picker
Posted: Tue Jul 07, 2015 12:49 am
by Alexar
qubodup wrote:Very nice! I hope some games will use it.
Issues
- missing terms of use (I recommend zlib/libpng license or cc0/public domain)
- using outer ring returns floating point numbers at times (I math.floor'ed them in the demo).
- it seems impossible to pick full saturation/black/white because the triangle touches the circle.
- scaled up, the circle is split (which looks cool though)
I made a prettier demo. My changes are cc0/public domain (no need to mention) but consider the font license info - it seems cc0/public domain like but I recommend including the text file.
http://youtu.be/0uAnn3_-Wwc
i like your demo, mine is just for showing it's simple to use.
you like the ring with lines or just a whole ring? you can edit the setLineWidth(3) to setLineWidth(self.size/100)
i forgot to translate the license to english that i wrote in chinese. free to use and no need to mention but dont claim it as your own.
Re: a simple color picker
Posted: Tue Jul 07, 2015 12:57 am
by Alexar
MicroMacro wrote:I was wondering if I could use either of your color pickers in a project of mine? I don't know exactly what this project is yet, but I can see it being very useful. All credit will be given.
feel free to use and i will fix something in the later version, plz keep on focus of this lib.
Re: a simple color picker
Posted: Tue Jul 14, 2015 11:22 pm
by Muzz
Awesome! New version has much nicer mouse behaviour!
I'm going to be using a version of this in Colour Constructor, so your code is going to be used by hundreds of artists. I must say man, that's some damn dense code without any comments. I may upload a commented version after i work out how everything works if you don't mind?
I'm going to add in Bool's to stop things rotating as most artists just find it annoying, but i guess it's not hard to leave in an option to keep it rotating if you want.
Re: a simple color picker
Posted: Wed Jul 15, 2015 12:31 am
by Alexar
Muzz wrote:Awesome! New version has much nicer mouse behaviour!
I'm going to be using a version of this in Colour Constructor, so your code is going to be used by hundreds of artists. I must say man, that's some damn dense code without any comments. I may upload a commented version after i work out how everything works if you don't mind?
I'm going to add in Bool's to stop things rotating as most artists just find it annoying, but i guess it's not hard to leave in an option to keep it rotating if you want.
thanks man, english is not my native language, i deleted comments in chinese :(。 just perform a surgery to this little one please
Re: a simple color picker
Posted: Sat Jan 21, 2017 2:19 pm
by yancouto
This latest version did not work with LÖVE 0.10.
I fixed it (it just needed some renames), hope it is useful.