Esempio n. 1
0
        protected virtual void GenerateOutlineButtonVariables(string variant, string inBorderColor, ThemeButtonOptions options)
        {
            var borderColor = ParseColor(inBorderColor);

            if (borderColor.IsEmpty)
            {
                return;
            }

            var color     = ToHex(borderColor);
            var yiqColor  = ToHex(Contrast(borderColor));
            var boxShadow = ToHexRGBA(Transparency(borderColor, 127));

            variables[ThemeVariables.OutlineButtonColor(variant)]          = color;
            variables[ThemeVariables.OutlineButtonYiqColor(variant)]       = yiqColor;
            variables[ThemeVariables.OutlineButtonBoxShadowColor(variant)] = boxShadow;
        }
Esempio n. 2
0
        protected virtual void GenerateOutlineButtonColorVariables(Theme theme, string variant, string inBorderColor, ThemeButtonOptions options)
        {
            var borderColor = ParseColor(inBorderColor);

            if (borderColor.IsEmpty)
            {
                return;
            }

            var color       = ToHex(borderColor);
            var yiqColor    = ToHex(Contrast(theme, borderColor));
            var boxShadow   = ToHexRGBA(Transparency(borderColor, 127));
            var hoverColor  = ToHex(Lighten(borderColor, options?.HoverLightenColor ?? 20f));
            var activeColor = ToHex(Darken(borderColor, options?.ActiveDarkenColor ?? 20f));

            variables[ThemeVariables.OutlineButtonColor(variant)]          = color;
            variables[ThemeVariables.OutlineButtonYiqColor(variant)]       = yiqColor;
            variables[ThemeVariables.OutlineButtonBoxShadowColor(variant)] = boxShadow;
            variables[ThemeVariables.OutlineButtonHoverColor(variant)]     = hoverColor;
            variables[ThemeVariables.OutlineButtonActiveColor(variant)]    = activeColor;
        }