Legacy Documentation: Version 4.5.0

Script language:

  • JS
  • C#
  • Boo
Script language

Select your preferred scripting language. All code snippets will be displayed in this language.

Color32.ToString

ToString(): string;
string ToString();
def ToString() as string
ToString(format: string): string;
string ToString(string format);
def ToString(format as string) as string

Description

Returns a nicely formatted string of this color.

var w : Color32 = Color.white;
print(w.ToString("x"));
using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour {
    public Color32 w = Color.white;
    void Example() {
        print(w.ToString("x"));
    }
}
import UnityEngine
import System.Collections

public class ExampleClass(MonoBehaviour):

	public w as Color32 = Color.white

	def Example() as void:
		print(w.ToString('x'))