Skip to content

Color function does not accept transparency #158

@rockstorm101

Description

@rockstorm101

The 'color' function does not work as expected. According to the docs [1], in its fourth form, this function is supposed to accept two parameters, namely: a string with the name of the colour and a floating point value for the transparency. Like color( "colorname", 1.0 ) { ... }. However, the following code:

import solid as sp

if __name__ == '__main__':
    cube = sp.cube([10,10,10], center = True)
    example = sp.color("Teal", 0.5)(cube)
    sp.scad_render_to_file(example, include_orig_code = False)

Produces the following error:

$ python bug_156.py 
Traceback (most recent call last):
  File "bug_156.py", line 5, in <module>
    example = sp.color("Teal", 0.5)(cube)
TypeError: __init__() takes 2 positional arguments but 3 were given

System Info:

  • SolidPython: 1.0.2
  • Python: 3.8.6
  • OS: Debian Sid

P.S.: Thank you so much for developing and maintaining this software. Love it!
P.S.2.: The latest version on PyPI is said to be '1.0.3' but the latest tag/release on GitHub is still '1.0.1'?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions