コード例 #1
0
        public static string ColorRgbDarken(string hex)
        {
            MudColor Color = ColorManager.FromHex(hex);

            Color = ColorManager.ColorDarken(Color, 0.075);
            return($"rgb({Color.R},{Color.G},{Color.B})");
        }
コード例 #2
0
        public static string ColorRgbDarken(string hex)
        {
            var color = ColorManager.FromHex(hex);

            color = ColorManager.ColorDarken(color, 0.075);
            return($"rgb({color.R},{color.G},{color.B})");
        }
コード例 #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);
        }
コード例 #4
0
 public MudColor Darken(MudColor color)
 {
     return(ColorManager.ColorDarken(color));
 }