Exemplo n.º 1
0
        protected virtual void GenerateTextColorVariables(Theme theme, string variant, string inColor)
        {
            var color = ParseColor(inColor);

            if (color.IsEmpty)
            {
                return;
            }

            variables[ThemeVariables.TextColor(variant)] = ToHex(color);
        }
Exemplo n.º 2
0
        protected virtual void GenerateProgressColorVariables(Theme theme, string variant, string inColor, ThemeProgressOptions options)
        {
            var inArgbColor = ParseColor(inColor);

            if (inArgbColor.IsEmpty)
            {
                return;
            }

            var color = ToHex(inArgbColor);

            variables[ThemeVariables.VariantPageProgressIndicator(variant)] = color;
        }
Exemplo n.º 3
0
        protected virtual void GenerateRatingColorVariables(Theme theme, string variant, string inColor, ThemeRatingOptions options)
        {
            var inArgbColor = ParseColor(inColor);

            if (inArgbColor.IsEmpty)
            {
                return;
            }

            var color = ToHex(inArgbColor);

            variables[ThemeVariables.VariantRatingColor(variant)] = color;
        }
Exemplo n.º 4
0
        protected virtual void GenerateBackgroundVariables(Theme theme, string variant, string inColor)
        {
            var backgroundColor = ParseColor(inColor);

            if (backgroundColor.IsEmpty)
            {
                return;
            }

            var backgroundYiqColor = Contrast(theme, backgroundColor);

            variables[ThemeVariables.BackgroundColor(variant)]    = ToHex(backgroundColor);
            variables[ThemeVariables.BackgroundYiqColor(variant)] = ToHex(backgroundYiqColor);
        }
Exemplo n.º 5
0
        protected virtual void GenerateStepsColorVariables(Theme theme, string variant, string inColor, ThemeStepsOptions options)
        {
            var argbColor = ParseColor(inColor);

            if (argbColor.IsEmpty)
            {
                return;
            }

            var color = ToHex(argbColor);

            variables[ThemeVariables.VariantStepsItemIcon(variant)]    = color;
            variables[ThemeVariables.VariantStepsItemIconYiq(variant)] = ToHex(Contrast(theme, color));
            variables[ThemeVariables.VariantStepsItemText(variant)]    = color;
        }
Exemplo n.º 6
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;
        }
Exemplo n.º 7
0
        protected virtual void GenerateButtonColorVariables(Theme theme, string variant, string inBackgroundColor, string inBorderColor, ThemeButtonOptions options)
        {
            var backgroundColor = ParseColor(inBackgroundColor);
            var borderColor     = ParseColor(inBorderColor);

            if (backgroundColor.IsEmpty)
            {
                return;
            }

            var hoverBackgroundColor     = Darken(backgroundColor, options?.HoverDarkenColor ?? 15f);
            var hoverBorderColor         = Lighten(borderColor, options?.HoverLightenColor ?? 20f);
            var activeBackgroundColor    = Darken(backgroundColor, options?.ActiveDarkenColor ?? 20f);
            var activeBorderColor        = Lighten(borderColor, options?.ActiveLightenColor ?? 25f);
            var yiqBackgroundColor       = Contrast(theme, backgroundColor);
            var yiqHoverBackgroundColor  = Contrast(theme, hoverBackgroundColor);
            var yiqActiveBackgroundColor = Contrast(theme, activeBackgroundColor);

            var background          = ToHex(backgroundColor);
            var border              = ToHex(borderColor);
            var hoverBackground     = ToHex(hoverBackgroundColor);
            var hoverBorder         = ToHex(hoverBorderColor);
            var activeBackground    = ToHex(activeBackgroundColor);
            var activeBorder        = ToHex(activeBorderColor);
            var yiqBackground       = ToHex(yiqBackgroundColor);
            var yiqHoverBackground  = ToHex(yiqHoverBackgroundColor);
            var yiqActiveBackground = ToHex(yiqActiveBackgroundColor);

            var boxShadow = ToHexRGBA(Transparency(Blend(yiqBackgroundColor, backgroundColor, 15f), options?.BoxShadowTransparency ?? 127));

            variables[ThemeVariables.ButtonBackground(variant)]          = background;
            variables[ThemeVariables.ButtonBorder(variant)]              = border;
            variables[ThemeVariables.ButtonHoverBackground(variant)]     = hoverBackground;
            variables[ThemeVariables.ButtonHoverBorder(variant)]         = hoverBorder;
            variables[ThemeVariables.ButtonActiveBackground(variant)]    = activeBackground;
            variables[ThemeVariables.ButtonActiveBorder(variant)]        = activeBorder;
            variables[ThemeVariables.ButtonYiqBackground(variant)]       = yiqBackground;
            variables[ThemeVariables.ButtonYiqHoverBackground(variant)]  = yiqHoverBackground;
            variables[ThemeVariables.ButtonYiqActiveBackground(variant)] = yiqActiveBackground;
            variables[ThemeVariables.ButtonBoxShadow(variant)]           = boxShadow;
        }
Exemplo n.º 8
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;
        }
Exemplo n.º 9
0
 protected virtual void GenerateBreakpointVariables(Theme theme, string name, string size)
 {
     variables[ThemeVariables.Breakpoint(name)] = size;
 }