public static string ColorRgbLighten(string hex)
        {
            MudColor Color = ColorManager.FromHex(hex);

            Color = ColorManager.ColorLighten(Color, 0.075);
            return($"rgb({Color.R},{Color.G},{Color.B})");
        }
Beispiel #2
0
        public static string ColorRgbLighten(string hex)
        {
            var color = ColorManager.FromHex(hex);

            color = ColorManager.ColorLighten(color, 0.075);
            return($"rgb({color.R},{color.G},{color.B})");
        }
Beispiel #3
0
        public string BuildColor(string Hex, ColorOption ColorOption, [Optional] double alpha, [Optional] int changevalue)
        {
            string CssVar      = "";
            int    ChangeValue = 25;

            if (changevalue != 0)
            {
                ChangeValue = changevalue;
            }

            MudColor Color = ColorManager.FromHex(Hex);

            switch (ColorOption)
            {
            case ColorOption.Rgb:
                CssVar = $"rgb({Color.R},{Color.G},{Color.B})";
                break;

            case ColorOption.RgbA:
                string Alpha = alpha.ToString("G", CultureInfo.InvariantCulture);
                CssVar = $"rgba({Color.R},{Color.G},{Color.B}, {Alpha})";
                break;

            case ColorOption.Lighten:
                Color  = ColorManager.ColorLighten(Color, ChangeValue);
                CssVar = $"rgb({Color.R},{Color.G},{Color.B})";
                break;

            case ColorOption.Darken:
                Color  = ColorManager.ColorDarken(Color, ChangeValue);
                CssVar = $"rgb({Color.R},{Color.G},{Color.B})";
                break;
            }
            return(CssVar);
        }
Beispiel #4
0
 public MudColor Lighten(MudColor color)
 {
     return(ColorManager.ColorLighten(color));
 }