First step towards making a color type with HSV representation.
Colors such as Color.RED or Color.BLUE continue to exist, but now you
can also define your own colors:
DARK_RED = Color(h=0, s=100, v=50)
Brown has the same hue as orange, just with a lower value and/or
saturation, so it does not need to have a separate Color instance.
It is also not supported by the color_map methods.
It was originally included in this list because the EV3 Color Sensor
can technically detect it. This is not reliable, however, as it is
also reports this value for orange objects at a slightly larger
distance. The implementation may be updated to return orange
in both cases. If the original values are required, the LUMPDevice
may be used to get the original color index.
Intellisense in VS Code (both jedi and ms python language server) picks
up all imported names and suggests them with equal priority for
code completion. By adding a leading underscore, intellisense lists
these with a lower priority, so they don't get in the way.
Also rename from builtins to _common while we are touching this to
better reflect the intention of the module (it contains types shared
by multiple modules, not builtin types like int).
This adds a _PybricksEnum base class for all enums. In Pybricks
MicroPython, we don't have an Enum class, but rather just simple
lookup tables.
The __repr__() method prints the enum values like the Pybricks
MicroPython implementation and also causes sphinx doc to correctly
print the value when used as a default value for aguments.
The __dir__() method is overloaded for both the instance and the class
to match what is seen in Pybricks MicroPython. This should help hide
things from code Python completion that are not present in MicroPython.