リポジトリ
使用例
using UniColorUtils;
using UnityEngine;
public class Example : MonoBehaviour
{
private void Start()
{
Debug.Log( ColorUtils.FromRGB( 255, 128, 0 ) );
Debug.Log( ColorUtils.FromRGBA( 255, 128, 0, 255 ) );
Debug.Log( ColorUtils.FromARGB( 255, 255, 128, 0 ) );
Debug.Log( ColorUtils.FromRGB( 0xFF8000 ) );
Debug.Log( ColorUtils.FromRGBA( 0xFF8000FF ) );
Debug.Log( ColorUtils.FromARGB( 0xFFFF8000 ) );
Debug.Log( ColorUtils.FromRGB( "#FF8000" ) );
Debug.Log( ColorUtils.FromRGBA( "#FF8000FF" ) );
Debug.Log( ColorUtils.ToRGBHtmlStringLower( Color.red ) );
Debug.Log( ColorUtils.ToRGBAHtmlStringLower( Color.red ) );
Debug.Log( ColorUtils.ToARGBHtmlStringLower( Color.red ) );
Debug.Log( ColorUtils.ToRGBHtmlStringUpper( Color.red ) );
Debug.Log( ColorUtils.ToRGBAHtmlStringUpper( Color.red ) );
Debug.Log( ColorUtils.ToARGBHtmlStringUpper( Color.red ) );
}
}