Eyedropper system

Hello, Is there a way to make an eyedropper system ingame for the color picker? Im trying to make it return the color exactly where the mouse is pointing, even guis.

what you are describing is not trivial to make. You basically need to make a special ray cast function then cast it out the pixel and see what color it returns. If everything in your game is solid objects though, no meshes and no decals then it is just what raycastResult.Instance.Color is. In general the pipeline will be

``
figure out if the mouse is colliding with any GUI elements (if over textlabel you will probably just need to simplify to black)

if not intersecting anything cast ray out and see what it returns
``

in general for accurate readings this just isnt realistically possible. I remember what I did one time is I had opencv scan a portion of my screen and I just had it scan the game I was playing and it would return a array of colors but would it really be possible for you to host a web server and have everyone run a sketchy python script?

1 Like

I’ve seen this done before using UIGradients, MousePosition and some magical math but the project wasn’t open sourced so I’m not sure how they did it. Probably getting MousePosition, then seeing where their mouse is hovering over using the UI’s absolute size and so on.

Goodluck!

1 Like

Yeah something like this in Roblox would be very hard to make.

It really depends on the type of colour picking system you want. I would alternatively go for a 3 progress bar style where I would be able to move 3 individual scroll bars and make a colour that way.

Alternatively you could try creating a sort of “map” where there are points on it with colours then your mouse would lerp multiply colours and figure out a colour.

Or if you want to be as simply as possible, have preset colours and then if the player doesn’t like them they can input a hexcode for the colour they want.

Oh, so there isnt any inbuilt function in roblox?

My color picker stuff is completed, I just wanted to add the eyedropper system.