Commit Graph
30 Commits
Author SHA1 Message Date
Laurens Valk e7dc4bb609 doc/parameters/Side: move doc to rst 2021-02-14 18:41:17 +01:00
Laurens Valk 3c6ebd09bd doc/parameters/Color: add examples 2021-02-12 10:53:40 +01:00
Laurens Valk af1b84afe2 api/parameters/Color: drop name attribute 2021-02-12 10:16:43 +01:00
Laurens Valk a2583944d9 api/geometry: move Axis from parameters
This location makes more sense. Also drop Axis.ANY = None, which is more confusing than helpful. Instead, use relevant docstring to explain what None will do.
2021-01-04 17:25:15 +01:00
Laurens Valk 08c55218fa api/parameters/Button: add bluetooth button 2020-12-30 12:36:37 +01:00
Laurens Valk 352bff564c api/parameters/Button: add remote buttons
Also clean up how it is displayed by reading the attributes from the API instead of copying them.
2020-12-30 12:27:12 +01:00
Laurens Valk 70ed79076d api/parameters: add Side enum
This will be used to designate orientations of hubs/sensors/screens.
2020-11-04 10:19:35 +01:00
Laurens Valk 6662862b43 api/parameters: Color divide value
This is the inverse of scaling by a constant through multiplication.
2020-10-07 09:17:02 +02:00
Laurens Valk 500bac9929 api/parameters/Color: allow scaling to alter hue
This makes it easy for users to vary brightness of the default colors without having to create a whole new object.
2020-08-26 21:12:48 +02:00
Laurens Valk 5e6a8c8334 api/parameters/Color: name is None by default
This is more consistent with the rest of our API.
2020-08-26 21:12:38 +02:00
Laurens Valk 9ae4955344 api/parameters/Color: no name by default
When no name is given, the color remains untitled
2020-08-25 16:27:19 +02:00
Laurens Valk 1eb75e24e7 api/parameters/Color: generalize color type
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)
2020-08-12 12:18:24 +02:00
Laurens Valk 70ffbfa4f3 doc/parameters/Color: sort colors by hue/value 2020-08-10 11:39:56 +02:00
Laurens Valk c987bc2f80 api/parameters/Color: add CYAN, MAGENTA, GRAY 2020-08-10 11:34:58 +02:00
Laurens Valk 7b8a848c61 api/parameters/Color: remove BROWN
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.
2020-08-10 11:29:48 +02:00
Laurens Valk 0c5457a5f2 api/parameters/Color: rename PURPLE to VIOLET
The correct term for hue = 270 is violet.
Purple is just magenta with a lower brightness value.
2020-08-10 11:29:32 +02:00
Laurens Valk 350b90d967 doc/parameters: document stop types in table
Make more explicit how the stop types gradually add more resistance to motion.
2020-04-28 14:01:28 +02:00
Laurens Valk c6f7b514ec doc: remove ascii art for motor directions
We have actual graphics of motors with their default clockwise directions now, so refer to those instead.
2020-04-28 13:27:51 +02:00
David Lechner 87c2b6857f api: Use leading _ to hide internals in intellisense
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).
2020-03-25 20:24:32 +01:00
Laurens Valk 066983a5e1 LICENSE: Update year and authors
Also add SPDX-License-Identifier: MIT to API source files for clarity.
2020-03-05 10:33:48 +01:00
Laurens Valk 10731d019a doc/parameters: remove Align
This was already hidden from the docs, but not deleted.
2020-03-03 17:43:53 +01:00
David Lechner 1b426b90f7 pybricks/parameters: introduce _PybricksEnum class
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.
2020-01-11 21:08:24 -06:00
Laurens Valk 8f4468880b api: move sounds, images to media submodule
These media are platform specific and do not belong in the generic parameters module.
2019-10-31 11:11:06 +01:00
Laurens Valk b5c9e3feb7 api: add simpler method for tilt
Provides a way of basic orientation checking independently of reference frame settings.
2019-07-04 11:55:01 +02:00
Laurens Valk e722451af1 api: add Axis.ALL identifier 2019-07-02 13:08:20 +02:00
Laurens Valk c722490b81 api: specify axes during setup 2019-07-02 12:13:05 +02:00
Laurens Valk e453cecb2e api: accelerometer drafts 2019-07-02 11:57:00 +02:00
Laurens Valk 6fb78141c5 doc: make ports specific to technology type 2019-06-06 10:51:48 +02:00
Laurens Valk 8d37450fac api: flake8 2019-06-04 15:45:36 +02:00
Laurens Valk 3091489843 move API 2019-05-09 17:15:52 +02:00