Add links

This commit is contained in:
Elod Csirmaz 2024-12-01 15:51:43 +00:00
parent bb7155a5fd
commit dc0a58c342
9 changed files with 68 additions and 23 deletions

View file

@ -7,8 +7,11 @@ from openscad_py.object_ import Object
class Color(Object):
"""Represents a color applied to an object.
See https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#color
"""
def __init__(self, child: Object, r, g, b, a=1.):
def __init__(self, child: Object, r: float, g: float, b: float, a: float = 1.):
self.color = [r, g, b, a]
self.child = child
@ -16,4 +19,3 @@ class Color(Object):
"""Render the object into OpenSCAD code"""
return f"color(c=[{','.join([str(c) for c in self.color])}]){{ {self.child.render()} }}"