From 0b226bc9aa78c4165cf185f94c7817e5f586c137 Mon Sep 17 00:00:00 2001 From: Peli de Halleux Date: Thu, 19 May 2016 11:59:57 -0700 Subject: [PATCH] updated category colors theme --- libs/microbit-radio/radio.ts | 2 +- libs/microbit/basic.cpp | 2 +- libs/microbit/game.ts | 46 ++++++++++++++++++------------------ libs/microbit/images.cpp | 2 +- libs/microbit/input.ts | 2 +- libs/microbit/led.ts | 4 ++-- libs/microbit/music.ts | 2 +- libs/microbit/pins.ts | 2 +- libs/microbit/serial.cpp | 2 -- libs/microbit/serial.ts | 2 +- libs/microbit/shims.d.ts | 4 ++-- pxtarget.json | 2 +- 12 files changed, 35 insertions(+), 37 deletions(-) diff --git a/libs/microbit-radio/radio.ts b/libs/microbit-radio/radio.ts index 942ca022..05f5c9ab 100644 --- a/libs/microbit-radio/radio.ts +++ b/libs/microbit-radio/radio.ts @@ -1,6 +1,6 @@ /** * Communicate data using radio packets */ -//% color=270 weight=34 +//% color=#E3008C weight=34 namespace radio { } diff --git a/libs/microbit/basic.cpp b/libs/microbit/basic.cpp index 15a4a97d..3711b948 100644 --- a/libs/microbit/basic.cpp +++ b/libs/microbit/basic.cpp @@ -4,7 +4,7 @@ /** * Provides access to basic micro:bit functionality. */ -//% color=190 weight=100 +//% color=#0078D7 weight=100 namespace basic { /** diff --git a/libs/microbit/game.ts b/libs/microbit/game.ts index 6fbd21cb..408316e6 100644 --- a/libs/microbit/game.ts +++ b/libs/microbit/game.ts @@ -21,19 +21,19 @@ enum LedSpriteProperty { /** * A single-LED sprite game engine */ -//% color=176 weight=32 +//% color=#008272 weight=32 namespace game { - var _score: number = 0; - var _life: number = 3; - var _startTime: number = 0; - var _endTime: number = 0; - var _isGameOver: boolean = false; - var _countdownPause: number = 0; - var _level: number = 1; - var _gameId: number = 0; - var img: Image; - var sprites: LedSprite[]; - + let _score: number = 0; + let _life: number = 3; + let _startTime: number = 0; + let _endTime: number = 0; + let _isGameOver: boolean = false; + let _countdownPause: number = 0; + let _level: number = 1; + let _gameId: number = 0; + let img: Image; + let sprites: LedSprite[]; + /** * Creates a new LED sprite pointing to the right. * @param x sprite horizontal coordinate, eg: 2 @@ -47,7 +47,7 @@ namespace game { sprites.push(p); plot(); return p; - } + } /** * Gets the current score @@ -394,7 +394,7 @@ namespace game { } plot(); } - + /** * Turn the sprite * @param this TODO @@ -403,7 +403,7 @@ namespace game { */ //% weight=49 //% blockId=game_turn_sprite block="%sprite|turn %direction|by (°) %degrees" - public turn(direction : Direction, degrees: number) { + public turn(direction: Direction, degrees: number) { if (direction == Direction.Right) this.setDirection(this._dir + degrees); else @@ -435,8 +435,8 @@ namespace game { */ //% weight=29 //% blockId=game_sprite_set_property block="%sprite|set %property|to %value" blockGap=8 - public set(property : LedSpriteProperty, value:number) { - switch(property) { + public set(property: LedSpriteProperty, value: number) { + switch (property) { case LedSpriteProperty.X: this.setX(value); break; case LedSpriteProperty.Y: this.setY(value); break; case LedSpriteProperty.Direction: this.setDirection(value); break; @@ -452,8 +452,8 @@ namespace game { */ //% weight=30 //% blockId=game_sprite_change_xy block="%sprite|change %property|by %value" blockGap=8 - public change(property : LedSpriteProperty, value:number) { - switch(property) { + public change(property: LedSpriteProperty, value: number) { + switch (property) { case LedSpriteProperty.X: this.changeXBy(value); break; case LedSpriteProperty.Y: this.changeYBy(value); break; case LedSpriteProperty.Direction: this.changeDirectionBy(value); break; @@ -461,15 +461,15 @@ namespace game { case LedSpriteProperty.Blink: this.changeBlinkBy(value); break; } } - + /** * Gets a property of the sprite * @param property the name of the property to change */ //% weight=28 //% blockId=game_sprite_property block="%sprite|%property" - public get(property : LedSpriteProperty) { - switch(property) { + public get(property: LedSpriteProperty) { + switch (property) { case LedSpriteProperty.X: return this.x(); case LedSpriteProperty.Y: return this.y(); case LedSpriteProperty.Direction: return this.direction() @@ -681,7 +681,7 @@ namespace game { function init(): void { if (img == null) { img = images.createImage( -`0 0 0 0 0 + `0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 diff --git a/libs/microbit/images.cpp b/libs/microbit/images.cpp index 707cd936..fc77dd10 100644 --- a/libs/microbit/images.cpp +++ b/libs/microbit/images.cpp @@ -3,7 +3,7 @@ /** * Creation, manipulation and display of LED images. */ -//% color=45 weight=31 +//% color=#5C2D91 weight=31 namespace images { /** * Creates an image that fits on the LED screen. diff --git a/libs/microbit/input.ts b/libs/microbit/input.ts index 35393132..d54aa37f 100644 --- a/libs/microbit/input.ts +++ b/libs/microbit/input.ts @@ -1,7 +1,7 @@ /** * Events and data from sensors */ -//% color=300 weight=99 +//% color=#B4009E weight=99 namespace input { /** * Attaches code to run when the screen is facing up. diff --git a/libs/microbit/led.ts b/libs/microbit/led.ts index 892c9e5c..901404b2 100644 --- a/libs/microbit/led.ts +++ b/libs/microbit/led.ts @@ -1,8 +1,8 @@ /** * Control of the LED screen. */ -//% color=3 weight=35 -namespace led { +//% color=#5C2D91 weight=35 + namespace led { // what's the current high value let barGraphHigh = 0; diff --git a/libs/microbit/music.ts b/libs/microbit/music.ts index 33e84ed8..58c3aabd 100644 --- a/libs/microbit/music.ts +++ b/libs/microbit/music.ts @@ -77,7 +77,7 @@ enum BeatFraction { /** * Generation of music tones through pin ``P0``. */ -//% color=52 weight=98 +//% color=#D83B01 weight=98 namespace music { let beatsPerMinute: number = 120; diff --git a/libs/microbit/pins.ts b/libs/microbit/pins.ts index 59da3495..2fb85ad5 100644 --- a/libs/microbit/pins.ts +++ b/libs/microbit/pins.ts @@ -1,7 +1,7 @@ /** * Control currents in Pins for analog/digital signals, servos, i2c, ... */ -//% color=351 weight=30 +//% color=#A80000 weight=30 namespace pins { /** * Re-maps a number from one range to another. That is, a value of ``from low`` would get mapped to ``to low``, a value of ``from high`` to ``to high``, values in-between to values in-between, etc. diff --git a/libs/microbit/serial.cpp b/libs/microbit/serial.cpp index 634edf8b..a891d36a 100644 --- a/libs/microbit/serial.cpp +++ b/libs/microbit/serial.cpp @@ -10,7 +10,6 @@ namespace serial { //% help=serial/read-line //% blockId=serial_read_line block="serial read line" //% weight=20 - //% async StringData* readLine() { return uBit.serial.readUntil(ManagedString("\n")).leakData(); } @@ -21,7 +20,6 @@ namespace serial { //% help=serial/write-string //% weight=87 //% blockId=serial_writestring block="serial write string %text" - //% async void writeString(StringData *text) { uBit.serial.send(ManagedString(text)); } diff --git a/libs/microbit/serial.ts b/libs/microbit/serial.ts index 368b7ecb..79ab1dc9 100644 --- a/libs/microbit/serial.ts +++ b/libs/microbit/serial.ts @@ -1,7 +1,7 @@ /** * Reading and writing data over a serial connection. */ -//% weight=2 color=30 +//% weight=2 color=#002050 namespace serial { /** * Prints a line of text to the serial diff --git a/libs/microbit/shims.d.ts b/libs/microbit/shims.d.ts index 4b0d11bf..bb7e23bb 100644 --- a/libs/microbit/shims.d.ts +++ b/libs/microbit/shims.d.ts @@ -4,7 +4,7 @@ /** * Creation, manipulation and display of LED images. */ - //% color=45 weight=31 + //% color=#5C2D91 weight=31 declare namespace images { /** @@ -113,7 +113,7 @@ declare interface Image { /** * Provides access to basic micro:bit functionality. */ - //% color=190 weight=100 + //% color=#0078D7 weight=100 declare namespace basic { /** diff --git a/pxtarget.json b/pxtarget.json index 495cadbd..99d44b27 100644 --- a/pxtarget.json +++ b/pxtarget.json @@ -72,7 +72,7 @@ "log": true }, "appTheme": { - "accentColor": "#5C2D91", + "accentColor": "#5C005C", "logoUrl": "https://m.pxt.io/about", "logo": "./static/microbit.simplified.svg", "docsLogo": "./static/microbit.simplified.svg",