ID:260469
 
Recently I saw quite a few people having trouble understanding the new icon.GetPixel() procedure (which I have trouble understanding too, as you can see in [link]). Could the reference be updated to contain a more detailed explanation please?
According to the current reference, out of what I understand of the GetPixel() procedure, I believe it returns the hex color code of the pixel. It is most likely supposed to be used with the mouse procs, since they have an icon-x and icon-y parameter, which is required in GetPixel().

And yea, an update to the reference would be nice since a lot of people use the reference.
The reference isn't exactly the easiest way to learn how to program things, its just there for when you need to know exactly how to use a certain function, or to find out if a certain function exists.

I don't understand what's so hard about it. It shows you the proc, which arguments it accepts, what each of those arguments mean, and what kind of return value you can expect. What more do you need?
In response to Foomer
The reference isn't exactly the easiest way to learn how to program things, its just there for when you need to know exactly how to use a certain function, or to find out if a certain function exists.

What are you trying to say here? I asked for a better explanation in the reference because of the unclearness in the documentation of a certain proc in there.

I don't understand what's so hard about it. It shows you the proc, which arguments it accepts, what each of those arguments mean, and what kind of return value you can expect. What more do you need?

Take a look at the thread I referred to. Following the reference, the code in there should output the color in coordinates px,py of the icon I clicked in, but it doesn't. I don't think this is a bug, and I know of a few other people using the proc like I did and having the same problems (no return value), so I figured there is a need for a more detailed explanation of this proc in the reference.
In response to DivineO'peanut
It returns the color of parameters "icon-x" and "icon-y".
In response to DivineO'peanut
DivineO'peanut wrote:
I don't think this is a bug, and I know of a few other people using the proc like I did and having the same problems (no return value)

That would kind of suggest that is IS a bug, wouldn't it? I just tested it and I can't make it work either, and I don't see any record on the forums or blogs of anyone actually using it anywhere, plus it is relatively new...
In response to Foomer
Ah, I just tried doing it and it returned null. That could be a problem.
obj
rainbow
icon='rainbow.dmi'
Click(location,control,params)
..()
var/icon/i=new(icon)
var/list/p=params2list(params)
var/ix=p["icon-x"]
var/iy=p["icon-y"]
for(var/o in p)usr<<"[o]=[p[o]]"
usr<<"[i.GetPixel(ix,iy)]"

Clicking on the rainbow in any pixel only tells the parameters, and an empty newline.
In response to Foomer
Uh, sorry, I was really tired when I wrote this post. I probably meant to file a bug report. Anyway, this can be either a bug or an unclear explanation of how the proc works. I don't want to start another thread about the same problem so I'll just leave it to the staff to determine.