IFC: import helper, add method to convert IFC color to RGB col
This commit is contained in:
@@ -449,6 +449,20 @@ def getColorFromMaterial(material):
|
||||
return None
|
||||
|
||||
|
||||
def color2colorRGB(color_data):
|
||||
|
||||
if color_data is None:
|
||||
return None
|
||||
|
||||
color_rgb = [
|
||||
int(round(color_data[0]*255, 0)),
|
||||
int(round(color_data[1]*255, 0)),
|
||||
int(round(color_data[2]*255, 0))
|
||||
] # int(159.99) would return 159 not 160, thus round
|
||||
|
||||
return color_rgb
|
||||
|
||||
|
||||
def getColorFromStyledItem(styled_item):
|
||||
"""Get color from the IfcStyledItem.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user