本文整理匯總了C#中Color.GetSaturation方法的典型用法代碼示例。如果您正苦於以下問題:C# Color.GetSaturation方法的具體用法?C# Color.GetSaturation怎麽用?C# Color.GetSaturation使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Color
的用法示例。
在下文中一共展示了Color.GetSaturation方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: SimilarColors
private static bool SimilarColors(Color colorOne, Color colorTwo)
{
if (Math.Abs(colorOne.GetHue()-colorTwo.GetHue()) <= 36)
{
//Console.WriteLine("Hue");
return true;
}
if (Math.Abs(colorOne.GetBrightness()-colorTwo.GetBrightness()) <= .1)
{
//Console.WriteLine("Hue");
return true;
}
if (Math.Abs(colorOne.GetSaturation()-colorTwo.GetSaturation()) <= .1)
{
//Console.WriteLine("Hue");
return true;
}
return false;
}
示例2: UpdateHsb
private void UpdateHsb(Color value) {
Hue = (int)value.GetHue();
var brightness = value.GetBrightness();
Brightness = (int)(brightness * 100);
var saturation = value.GetSaturation();
Saturation = (int)(saturation * 100);
UpdateThumbPosition();
}
示例3: HSLColor
public HSLColor(Color color)
{
Hue = color.GetHue();
Saturation = color.GetSaturation();
Lightness = color.GetBrightness();
}
示例4: ColorNum
public static float ColorNum(Color c)
{
var factorSat = 3;
var factorBri = 3;
return c.GetSaturation() * factorSat + GetBrightness(c) * factorBri;
}