mirror of
https://github.com/pybricks/pybricks-api.git
synced 2026-07-28 04:07:46 +00:00
parameters: change Color enum members to uppercase
This commit is contained in:
@@ -34,12 +34,13 @@ def light(color):
|
||||
"""Set the color of the brick light.
|
||||
|
||||
Arguments:
|
||||
color (Color): Color of the light. Choose ``Color.black`` or ``None`` to turn the light off.
|
||||
color (Color): Color of the light. Choose ``Color.BLACK`` or ``None``
|
||||
to turn the light off.
|
||||
|
||||
Example::
|
||||
|
||||
# Make the light red
|
||||
brick.light(Color.red)
|
||||
brick.light(Color.RED)
|
||||
|
||||
# Turn the light off
|
||||
brick.light(None)
|
||||
|
||||
@@ -313,7 +313,8 @@ class ColorSensor():
|
||||
"""Measure the color of a surface.
|
||||
|
||||
:returns:
|
||||
``Color.black``, ``Color.blue``, ``Color.green``, ``Color.yellow``, ``Color.red``, ``Color.white``, ``Color.brown`` or ``None``.
|
||||
``Color.BLACK``, ``Color.BLUE``, ``Color.GREEN``, ``Color.YELLOW``,
|
||||
``Color.RED``, ``Color.WHITE``, ``Color.BROWN`` or ``None``.
|
||||
:rtype: :class:`Color <parameters.Color>`, or ``None`` if no color is detected.
|
||||
"""
|
||||
pass
|
||||
|
||||
+18
-18
@@ -6,26 +6,26 @@ from enum import Enum
|
||||
class Color(Enum):
|
||||
"""Light or surface color.
|
||||
|
||||
.. data:: black
|
||||
.. data:: blue
|
||||
.. data:: green
|
||||
.. data:: yellow
|
||||
.. data:: red
|
||||
.. data:: white
|
||||
.. data:: brown
|
||||
.. data:: orange
|
||||
.. data:: purple
|
||||
.. data:: BLACK
|
||||
.. data:: BLUE
|
||||
.. data:: GREEN
|
||||
.. data:: YELLOW
|
||||
.. data:: RED
|
||||
.. data:: WHITE
|
||||
.. data:: BROWN
|
||||
.. data:: ORANGE
|
||||
.. data:: PURPLE
|
||||
"""
|
||||
|
||||
black = 1
|
||||
blue = 2
|
||||
green = 3
|
||||
yellow = 4
|
||||
red = 5
|
||||
white = 6
|
||||
brown = 7
|
||||
orange = 8
|
||||
purple = 9
|
||||
BLACK = 1
|
||||
BLUE = 2
|
||||
GREEN = 3
|
||||
YELLOW = 4
|
||||
RED = 5
|
||||
WHITE = 6
|
||||
BROWN = 7
|
||||
ORANGE = 8
|
||||
PURPLE = 9
|
||||
|
||||
|
||||
class Port(Enum):
|
||||
|
||||
Reference in New Issue
Block a user