mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-24 23:12:24 -05:00
Lint
This commit is contained in:
parent
bddabdbac6
commit
0a18ce7287
1 changed files with 16 additions and 17 deletions
|
@ -321,7 +321,7 @@ class Scratch3PenBlocks {
|
||||||
menus: {
|
menus: {
|
||||||
colorParam:
|
colorParam:
|
||||||
[ColorParam.COLOR, ColorParam.SATURATION,
|
[ColorParam.COLOR, ColorParam.SATURATION,
|
||||||
ColorParam.BRIGHTNESS, ColorParam.TRANSPARENCY]
|
ColorParam.BRIGHTNESS, ColorParam.TRANSPARENCY]
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -412,7 +412,7 @@ class Scratch3PenBlocks {
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
_updatePenColor (penState) {
|
_updatePenColor (penState) {
|
||||||
let rgb = Color.hsvToRgb({
|
const rgb = Color.hsvToRgb({
|
||||||
h: penState.color * 360 / 100,
|
h: penState.color * 360 / 100,
|
||||||
s: penState.saturation / 100,
|
s: penState.saturation / 100,
|
||||||
v: penState.brightness / 100
|
v: penState.brightness / 100
|
||||||
|
@ -433,21 +433,20 @@ class Scratch3PenBlocks {
|
||||||
*/
|
*/
|
||||||
_setOrChangeColorParam (param, value, penState, change) {
|
_setOrChangeColorParam (param, value, penState, change) {
|
||||||
switch (param) {
|
switch (param) {
|
||||||
case ColorParam.COLOR:
|
case ColorParam.COLOR:
|
||||||
penState.color = this._wrapColor(value + (change ? penState.color : 0));
|
penState.color = this._wrapColor(value + (change ? penState.color : 0));
|
||||||
break;
|
break;
|
||||||
case ColorParam.SATURATION:
|
case ColorParam.SATURATION:
|
||||||
penState.saturation = this._clampColorParam(value + (change ? penState.saturation : 0));
|
penState.saturation = this._clampColorParam(value + (change ? penState.saturation : 0));
|
||||||
break;
|
break;
|
||||||
case ColorParam.BRIGHTNESS:
|
case ColorParam.BRIGHTNESS:
|
||||||
penState.brightness = this._clampColorParam(value + (change ? penState.brightness : 0));
|
penState.brightness = this._clampColorParam(value + (change ? penState.brightness : 0));
|
||||||
break;
|
break;
|
||||||
case ColorParam.TRANSPARENCY:
|
case ColorParam.TRANSPARENCY:
|
||||||
penState.transparency = this._clampColorParam(value + (change ? penState.transparency : 0));
|
penState.transparency = this._clampColorParam(value + (change ? penState.transparency : 0));
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
log.warn(`Tried to set or change unknown color parameter: ${param}`);
|
log.warn(`Tried to set or change unknown color parameter: ${param}`);
|
||||||
|
|
||||||
}
|
}
|
||||||
this._updatePenColor(penState);
|
this._updatePenColor(penState);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue