0

现在我正在做;

           var backGradient2 = new GradientStop();
           backGradient1.Offset = 0.5;
           backGradient1.Color = Colors.Yellow;

但我需要传递 #FF0B3663 之类的字符串

任何想法?

谢谢

4

1 回答 1

0

Use ColorConverter's method ConvertFromString to convert hex string value to actual color value:

backGradient1.Color = (Color)ColorConverter.ConvertFromString("#FF0B3663");
于 2014-04-22T16:51:27.067 回答