api:umfconfig:parser_umfconfigcolorhexrgba
Description:
Default Color parser.
Added In: v0.50
Function
public class UMFConfigColorHexRGBA : UMFConfigParser<Color> { public Color DefaultValue; public bool RequiresRestart; public UMFConfigColorHexRGBA(Color defaultValues = default(Color), bool requiresRestart = false) { DefaultValue = defaultValues; RequiresRestart = requiresRestart; } public override Color Parse(string value) { if (ColorUtility.TryParseHtmlString(value, out Color color)) return color; else return Color.white; } public override string ToString() { return "#" + ColorUtility.ToHtmlStringRGBA(DefaultValue); } public override string Default() { return "#" + ColorUtility.ToHtmlStringRGBA(DefaultValue); } public override string Restart() { return RequiresRestart.ToString(); } }
Usage
//Coming soon
Examples
//Coming soon
api/umfconfig/parser_umfconfigcolorhexrgba.txt · Last modified: 2019/06/29 23:34 by umfdev