本文整理汇总了C#中Color.Alpha方法的典型用法代码示例。如果您正苦于以下问题:C# Color.Alpha方法的具体用法?C# Color.Alpha怎么用?C# Color.Alpha使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Color
的用法示例。
在下文中一共展示了Color.Alpha方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DrawRectFillAlpha
public static void DrawRectFillAlpha(Rect rect, Color color, float alpha)
{
Color guiColor = GUI.color;
GUI.color = color.Alpha(alpha);
GUI.DrawTexture(rect, wHiteTex);
GUI.color = color.Alpha(1);
GUI.DrawTexture(new Rect(rect.x, rect.y, rect.width, 1+0*rect.height), wHiteTex);
GUI.DrawTexture(new Rect(rect.x, rect.y, 1+0*rect.width, rect.height), wHiteTex);
GUI.DrawTexture(new Rect(rect.x + rect.width, rect.y + rect.height, -rect.width, -1+0*rect.height), wHiteTex);
GUI.DrawTexture(new Rect(rect.x + rect.width, rect.y + rect.height, -1+0*rect.width, -rect.height), wHiteTex);
GUI.color = guiColor;
}
示例2: DrawRectFillPCAlpha
public static void DrawRectFillPCAlpha(Rect rect, Color color, float alpha, float pc)
{
Color guiColor = GUI.color;
float w = rect.width * pc;
float iw = rect.width - w;
GUI.color = color.Alpha(alpha);
GUI.DrawTexture(new Rect(rect.x + w, rect.y, iw, rect.height), wHiteTex);
GUI.color = color.Alpha(1);
GUI.DrawTexture(new Rect(rect.x, rect.y, w, rect.height), wHiteTex);
GUI.DrawTexture(new Rect(rect.x, rect.y, rect.width, 1+0*rect.height), wHiteTex);
GUI.DrawTexture(new Rect(rect.x, rect.y, 1+0*rect.width, rect.height), wHiteTex);
GUI.DrawTexture(new Rect(rect.x + rect.width, rect.y + rect.height, -rect.width, -1+0*rect.height), wHiteTex);
GUI.DrawTexture(new Rect(rect.x + rect.width, rect.y + rect.height, -1+0*rect.width, -rect.height), wHiteTex);
GUI.color = guiColor;
}
示例3: AddAlphaToColor
private INode AddAlphaToColor(Color color, Number number)
{
var alpha = GetAlphaValue(number);
return color.Alpha(alpha);
}