I want to convert a color to RGB, currently I receive a color in RGBA from a Gameobject, I store it in a string after converting it to RGB.
What I can't do is convert that string that contains the RGB color into a Color type .
Color componentColor = GetComponent<MeshRenderer>().material.color;
string colorParseadoRGB = ColorUtility.ToHtmlStringRGBA(componentColor);
I am trying to convert to Color using:
string color = "#" + colorParseadoRGB;
Color c;
ColorUtility.TryParseHtmlString(color, out c);
The string if returns me the color in RGB but the Color c still returns me in RGBA .
You just have to use the opposite function in ColorUtility:
(remember to add the '#' character at the beginning of the string representing the color)