728x90
반응형
/// <summary>
/// Random Color
/// </summary>
/// <returns></returns>
private Brush RandomBrush()
{
    Brush result = Brushes.Transparent;

    Random random = new Random();

    Type brushesType = typeof(Brushes);

    PropertyInfo[] properties = brushesType.GetProperties();

    int randomValue = random.Next(properties.Length);
    result = (Brush)properties[randomValue].GetValue(null, null);

    return result;
}

 

728x90
반응형

+ Recent posts