User Tools

Site Tools


Action disabled: register
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


This topic does not exist yet

You've followed a link to a topic that doesn't exist yet. If permissions allow, you may create it by clicking on Create this page.

api/umfconfig/parser_umfconfigcolorhexrgba.txt · Last modified: 2019/06/29 23:34 by umfdev