Hi there guys,
I am working on a color picker for my app,
Especially is my current problem to position the marker to the coresponding color when a user provides a hexcode or RGBA colors.
Is there any extension for this?
If using the canvas, you would need to iterate over each pixel, get the colour for that pixel, and compare it with the supplied colour. If there is a match, then place the marker on that pixel location. This might take some considerable time with a high resolution image.
Well @TIMAI2, I foznd an extension to covert RGB to HSV ([FREE] Color Converter) and as I found out it's possible to do what I want (with a color wheel).
Once I got the blocka set up i'll send a screenshot of how I did it.
Are you adjusting your x/y with the centre of the colour wheel , remembering that the canvas top left = 0/0
You should also bear in mind, that with a canvas of 200x200 for your colour wheel, the maximum numbers of colours it can return is 40,000. In reality this will be much less, say @ 3000. This is a far reach from the possible 16.7 million colours you can generate from an RGB value. You will only get a max of 0.24% of colours addressable by RGB. Think on
But do you know how I could calculate it so it might work?
Um, I think for underglow (thats what I wanna control with that app) of a vehicle I don't really need all 16.7 million colors. If I remember right I got about 60 LED per meter (3,3 feet)
The thing is, a user can type in the RGB values, the colour can then be displayed, as you are doing, in an arrangement as a background colour, but the colour may not exist on the colour wheel, so it cannot be identified by a marker.
There might be a way to identify a similar colour, that is on the colour wheel, with the one entered, and place the marker there, using a predefined table of some kind, but this could be overly complex?
Ok, thanks. Ya I didn't really think about that fact. It would have been very cool but if it is as complicated as mentioned I don't need it. As it is a private app.