kopia lustrzana https://github.com/backface/turtlestitch
added color extension primitives
rodzic
edc0196e69
commit
9c582e785e
|
@ -7,6 +7,9 @@
|
|||
* **Notable Fixes:**
|
||||
* fixed occasional invisible error messages
|
||||
|
||||
### 2021-06-19
|
||||
* extensions: added color extension primitives
|
||||
|
||||
### 2021-06-18
|
||||
* extensions: added text extension primitives
|
||||
* updated strings library
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
<script src="src/sketch.js?version=2020-07-13"></script>
|
||||
<script src="src/video.js?version=2019-06-27"></script>
|
||||
<script src="src/maps.js?version=2021-06-15"></script>
|
||||
<script src="src/extensions.js?version=2021-06-18"></script>
|
||||
<script src="src/extensions.js?version=2021-06-19"></script>
|
||||
<script src="src/xml.js?version=2020-04-27"></script>
|
||||
<script src="src/store.js?version=2021-06-10"></script>
|
||||
<script src="src/locale.js?version=2021-06-11"></script>
|
||||
|
|
|
@ -28,9 +28,10 @@
|
|||
// Global settings /////////////////////////////////////////////////////
|
||||
|
||||
/*global modules, List, StageMorph, Costume, SpeechSynthesisUtterance, Sound,
|
||||
IDE_Morph, CamSnapshotDialogMorph, SoundRecorderDialogMorph, isSnapObject, nop*/
|
||||
IDE_Morph, CamSnapshotDialogMorph, SoundRecorderDialogMorph, isSnapObject, nop,
|
||||
Color, contains*/
|
||||
|
||||
modules.extensions = '2021-June-18';
|
||||
modules.extensions = '2021-June-19';
|
||||
|
||||
// Global stuff
|
||||
|
||||
|
@ -580,10 +581,43 @@ SnapExtensions.primitives.set(
|
|||
);
|
||||
*/
|
||||
|
||||
// Brian's colors (sigh, clr_):
|
||||
// Colors (clr_):
|
||||
|
||||
SnapExtensions.primitives.set(
|
||||
'clr_rgba(r, g, b, a)',
|
||||
function (r, g, b, a) {
|
||||
return new Color(r, g, b, a);
|
||||
}
|
||||
);
|
||||
|
||||
SnapExtensions.primitives.set(
|
||||
'clr_channel(clr, rgba)',
|
||||
function (clr, rgba) {
|
||||
if (contains(['r', 'g', 'b', 'a'], rgba)) {
|
||||
return clr[rgba];
|
||||
}
|
||||
throw new Error('unknown rgba color channel "' + rgba + '"');
|
||||
}
|
||||
);
|
||||
|
||||
SnapExtensions.primitives.set(
|
||||
'clr_hsv(h, s, v)',
|
||||
function (h, s, v) {
|
||||
var c = new Color();
|
||||
c.set_hsv(h, s, v);
|
||||
return c;
|
||||
}
|
||||
);
|
||||
|
||||
SnapExtensions.primitives.set(
|
||||
'clr_setpen(clr)',
|
||||
function (clr) {
|
||||
this.setColor(clr);
|
||||
}
|
||||
);
|
||||
|
||||
SnapExtensions.menus.set(
|
||||
'clr_numbers',
|
||||
'clr_numbers', // Brian's browns and oranges, sigh...
|
||||
function () {
|
||||
var menuName = this.parent.inputs()[0].evaluate(), // first slot
|
||||
output,
|
||||
|
|
Ładowanie…
Reference in New Issue