본문 바로가기
Unity3D/Unity & C#

Unity & C# ~ string.Format 글자 색상 적용

by 캬캬백곰 2022. 9. 26.
728x90
[SerializeField] Text text;

void Start()
{
	Color c = Color.blue;
    text.text = string.Format($"<color=#{c.ToHexString()}>Text</color>");
}

 

728x90
반응형