How do I take a float (0f to 1f) and convert that to a byte (not a byte array) for a Color32’s alpha channel (0-255)?
I have an function I wrote awhile back, SetAlpha, that takes a float from 0f to 1f and sets it to the alpha channel of a Color. With some new changes I’ve made, I now need to use Color32 instead of Color to set alpha. Accessing .a doesn’t work as it takes a byte, not a float (and I can’t Mathf.RoundToInt either).
I suspect this is probably pretty simple but I’ve never worked with Color32 before, and don’t know the syntax. Thank you!