Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do I get Color3 from a clothing item?

I ran into a problem that I just can't seem to figure out. I need to get the Color3 value from a shirt to apply to a textbox so it may be edited while players roleplay.

I've tried to simply print it, used fromRGB, and tried turning it to a string. Each time it came out as 1, 1, 1.

2 comments

0

The Color3 is always represented as a matrix having each number between 0 and 1.

0

but why is it that using Color3.fromRGB allow 0 to 255? Color3 for clothing items are 0 to 255.

1 answer

The range differs. new() and fromHSV() allow a range from 0-1. fromRGB() ranges from 0 to 255.

Also, I do not think you can get the color of a shirt as it is a bitmap image. If you do want to try anyways, I would write an API outside of Roblox do some techno-gizmo stuff where it parses the image and finds the median color range. I wouldn't actually recommend this for any game since it requires a pointless amount of time and resources to make.

An alternative is to simply store color data through a Color3 instance as a child of the shirt. Then read the value of the instance.

If this was not what you meant, just message me.

This discussion is preserved as it was. New answers, comments, and votes are closed.