- Home /
Unity colours - how do I get the RGBA value outside of Unity?
I have imported some coloured sprites into Unity. I'd like to be able to retrieve the colour information from them using get pixel. Then depending on the colour I'd like to call different functions.
I pretty much know how to do that, except I don't know how to figure out the RGBA values of the colours in my sprites before they get into Unity. I can't write which colour values to check for into my code because Unity uses a system that no other program seems to use.
Maybe I just don't know what to search for but I can't find anything online. Ideally looking for something like this: http://www.december.com/html/spec/colorrgbadec.html
Am thinking of rewriting my all my code to just use Color32, which seems to be a bit more familiar, but am hoping there's just something I'm missing.
Thankyou!
EDIT
Forgot to point out that its easy enough to get normal RGB values in photshop just using the info window, but its not in the 0 to 1 format that Unity uses, they go up to 255.
wizard, as much as I hate maths I'll take that as an answer. Thanks! If you want, I can mark it correct if you convert the comment to an answer
Answer by roojerry · May 29, 2014 at 04:00 PM
divide your photoshop color values by 255
new Color(photoshopR/255f, photoshopG/255f, photoshopB/255f);
Your answer
Follow this Question
Related Questions
Default color issue 2 Answers
Convert Color32 to Color 1 Answer
Not exact color 1 Answer