new (hidden) pen-color-model preference setting (per session)

snap7
jmoenig 2021-11-10 14:28:12 +01:00
rodzic 4022ede091
commit 4021f5899a
4 zmienionych plików z 27 dodań i 4 usunięć

Wyświetl plik

@ -53,6 +53,7 @@
### 2021-11-10
* objects, store: new "penColorModel" setting, can e 'hsv' or 'hsl'
* gui, objects: new (hidden) pen-color-model preference setting (per session)
### 2021-11-09
* objects, store: refactored block-migration mechanism

Wyświetl plik

@ -20,7 +20,7 @@
<script src="src/threads.js?version=2021-11-08"></script>
<script src="src/objects.js?version=2021-11-10"></script>
<script src="src/scenes.js?version=2021-10-12"></script>
<script src="src/gui.js?version=2021-11-09"></script>
<script src="src/gui.js?version=2021-11-10"></script>
<script src="src/paint.js?version=2021-07-05"></script>
<script src="src/lists.js?version=2021-07-19"></script>
<script src="src/byob.js?version=2021-11-09"></script>

Wyświetl plik

@ -86,7 +86,7 @@ BlockVisibilityDialogMorph*/
// Global stuff ////////////////////////////////////////////////////////
modules.gui = '2021-November-09';
modules.gui = '2021-November-10';
// Declarations
@ -3845,6 +3845,22 @@ IDE_Morph.prototype.settingsMenu = function () {
true
);
}
addPreference(
'HSV pen color model',
() => SpriteMorph.prototype.penColorModel = 'hsv',
SpriteMorph.prototype.penColorModel === 'hsv',
null,
null,
true
);
addPreference(
'HSL pen color model',
() => SpriteMorph.prototype.penColorModel = 'hsl',
SpriteMorph.prototype.penColorModel === 'hsl',
null,
null,
true
);
addPreference(
'Input sliders',
'toggleInputSliders',

Wyświetl plik

@ -4449,7 +4449,10 @@ SpriteMorph.prototype.setColorDimension = function (idx, num) {
this.color.a = 1 - n / 100;
} else {
this.cachedColorDimensions[idx] = n / 100;
this.color.set_hsl.apply(this.color, this.cachedColorDimensions);
this.color['set_' + this.penColorModel].apply(
this.color,
this.cachedColorDimensions
);
}
if (!this.costume) {
this.rerender();
@ -9295,7 +9298,10 @@ StageMorph.prototype.setColorDimension = function (idx, num) {
this.color.a = 1 - n / 100;
} else {
this.cachedColorDimensions[idx] = n / 100;
this.color.set_hsl.apply(this.color, this.cachedColorDimensions);
this.color['set_' + SpriteMorph.prototype.penColorModel].apply(
this.color,
this.cachedColorDimensions
);
}
this.rerender();
};