Assigning Color to Lines in SpecklePy

We’re currently navigating the functionalities of SpecklePy within our Building.py (GitHub - 3BMLabs/building.py: Python Library for creating buildings, building systems, objects, and exporting to various programs like Blender, Revit, Speckle.) environment. Our current query revolves around assigning colors to lines in SpecklePy.

Could someone provide guidance on how to give a line a color using SpecklePy? If possible, do you have a code example that demonstrates this process?

Any insights, code snippets, or suggestions would be immensely helpful as we strive to enhance our workflow with SpecklePy.

Typically, 3D objects have a visible aspect that is a combination of DisplayValue Mesh(es) with RenderMaterial property objects.

This is best implemented for lines with a displayStyle property on the 2D geometry objects.

So, implementing a colour on a line could be as simple as:"

line = Line()
line["displayStyle"] = {"color": (255 << 24) + (R << 16) + (G << 8) + B}

It is also possible to set a full RenderMaterial object definition to the displayStyle property