Click or drag to resize

ColorWithTransparencyConverterToColorWithTransparency Method

Converts the specified Color to an equivalent Autodesk.Revit.DB.ColorWithTransparency.

Namespace:  RhinoInside.Revit.Convert.System.Drawing
Assembly:  RhinoInside.Revit (in RhinoInside.Revit.dll) Version: 1.7.8130
Syntax
public static Autodesk.Revit.DB.ColorWithTransparency ToColorWithTransparency(
	this Color color
)

Parameters

color
Type: System.DrawingColor
System color to convert.

Return Value

Type: Autodesk.Revit.DB.ColorWithTransparency
Revit color that is equivalent to the provided System color.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Color. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
Examples
Using ToColorWithTransparency(Color) as extension method:
using System.Drawing;
using DB = Autodesk.Revit.DB;
using RhinoInside.Revit.Convert.System.Drawing;

DB.ColorWithTransparency revitColor = color.ToColorWithTransparency();
Using ToColorWithTransparency(Color) as static method:
using System.Drawing;
using DB = Autodesk.Revit.DB;
using RhinoInside.Revit.Convert.System.Drawing;

DB.ColorWithTransparency revitColor = ColorConverter.ToColorWithTransparency(color)
See Also