Click or drag to resize

ColorConverterToColor Method (Color)

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

Namespace:  RhinoInside.Revit.Convert.System.Windows.Media
Assembly:  RhinoInside.Revit (in RhinoInside.Revit.dll) Version: 1.7.8130
Syntax
public static Autodesk.Revit.DB.Color ToColor(
	this Color color
)

Parameters

color
Type: System.Windows.MediaColor
System color to convert.

Return Value

Type: Autodesk.Revit.DB.Color
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 ToColor(Color) as extension method:
using System.Windows.Media;
using DB = Autodesk.Revit.DB;
using RhinoInside.Revit.Convert.System.Windows.Media;

DB.Color revitColor = color.ToColor();
Using ToColor(Color) as static method:
using System.Windows.Media;
using DB = Autodesk.Revit.DB;
using RhinoInside.Revit.Convert.System.Windows.Media;

DB.Color revitColor = ColorConverter.ToColor(color)
See Also