api:umfconfig:parser_umfconfigcolorhexrgba
Description:
Default Color parser.
Added In: v0.50
Function
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
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
1 |
//Coming soon |
Examples
1 |
//Coming soon |
api/umfconfig/parser_umfconfigcolorhexrgba.txt · Last modified: 2019/06/29 23:34 by umfdev