mirror of
https://github.com/csirmaz/openscad-py.git
synced 2025-07-10 02:54:23 +02:00
Add links
This commit is contained in:
parent
bb7155a5fd
commit
dc0a58c342
9 changed files with 68 additions and 23 deletions
|
@ -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()} }}"
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue