Note that field ordering of dicts is only maintained in newer python versions (officially since 3.7, but also in CPython 3.6).
>>> c = {"r": 50, "g": 205, "b": 50, "alpha": alpha}
>>> Color = namedtuple("Color", c)
>>> Color(**c)
Color(r=50, g=205, b=50, alpha=0)
Machine Learning Software Engineer - Hobbyst Technical Writer - Interested in Software Testing, Best Practices, Scalability, and Python.