turtlestitch/libraries/colors.xml

1 wiersz
255 KiB
XML

2022-01-05 17:09:51 +00:00
<blocks app="Snap! 7, https://snap.berkeley.edu" version="2"><block-definition s="$brush set pen %&apos;dimension&apos; to %&apos;value&apos; %&apos;more value&apos;" type="command" category="pen"><comment w="265.3333333333333" collapsed="false">This block allows you to set the pen&apos;s color, transparency (on a scale from 0=opaque to 100=invisible), or size (in pixels). The color can be set in many ways, including RGB values, HSV values, HSL values, fair HSV or HSL (based on a modified spectrum that gives each spectral color equal space and promotes brown to a color), color number, crayon, or X11/W3C color name.&#xD;&#xD;See Appendix A in the Snap! Reference Manual for details.</comment><header></header><code></code><translations>ca:$brush fixa el _ del llapis a _ _&#xD;</translations><inputs><input type="%s" readonly="true"><options>color&#xD;color number&#xD;crayon&#xD;fair hue&#xD;&#126;1&#xD;size&#xD;transparency&#xD;X11/W3C name&#xD;&#126;2&#xD;(3D color spaces)={&#xD;fair HSL={&#xD;fair hue&#xD;fair saturation (HSL)&#xD;fair lightness&#xD;fair HSL vector&#xD;}&#xD;fair HSV={&#xD;fair hue&#xD;fair saturation (HSV)&#xD;fair value (brightness)&#xD;fair HSV vector&#xD;}&#xD;HSL={&#xD;hue&#xD;saturation (HSL)&#xD;lightness&#xD;HSL vector&#xD;}&#xD;HSV={&#xD;hue&#xD;saturation (HSV)&#xD;value (brightness)&#xD;HSV vector&#xD;}&#xD;RGB (0-255)={&#xD;red&#xD;green&#xD;blue&#xD;RGB(A) vector&#xD;RGB(A) hex&#xD;}&#xD;}</options></input><input type="%s"><options>§_ext_clr_numbers</options></input><input type="%mult%s"></input></inputs><script><custom-block s="✐ initialize variables"></custom-block><block s="doRun"><block s="reportAttributeOf"><block s="reportListItem"><block s="reportListIndex"><block var="dimension"/><block var="✐ dimension names"/></block><block var="✐ dimension dispatch"/></block><block s="reportGet"><l><option>self</option></l></block></block><list><block var="value"/><block var="more value"/></list></block></script><scripts><comment x="460.0888671875" y="4175.599999999967" w="251.33333333333334" collapsed="false">Note to myself: When the user sets a fair dimension, say fair HSL, variable HSL contains the corresponding &quot;unfair&quot; values, and &quot;raw HSL&quot; contains the numbers the user actually gave. It has to be this way because in the case of HSV, there is no &quot;HSV&quot; variable; rather, we use the pen&apos;s actual remembered-by-Javascript color&apos;s HSV coordinates. So our HSL variable has to be analogous to that. In both cases &quot;raw&quot; means the numbers the user gave us.</comment></scripts></block-definition><block-definition s="mmap %&apos;function&apos; over %&apos;lists&apos;" type="reporter" category="lists"><header></header><code></code><translations></translations><inputs><input type="%repRing"></input><input type="%mult%l"></input></inputs><script><block s="doIf"><block s="reportListIsEmpty"><block s="reportListItem"><l>1</l><block var="lists"/></block></block><script><block s="doReport"><block s="reportNewList"><list></list></block></block></script></block><block s="doReport"><block s="reportCONS"><block s="evaluate"><block var="function"/><block s="reportAtomicMap"><block s="reifyReporter"><autolambda><block s="reportListItem"><l>1</l><l/></block></autolambda><list></list></block><block var="lists"/></block></block><custom-block s="mmap %repRing over %mult%l"><block var="function"/><block s="reportAtomicMap"><block s="reifyReporter"><autolambda><block s="reportCDR"><l/></block></autolambda><list></list></block><block var="lists"/></block></custom-block></block></block></script></block-definition><block-definition s="✐ update HSL" type="command" category="other"><header></header><code></code><translations></translations><inputs></inputs><script><block s="doDeclareVariables"><list><l>L</l></list></block><block s="doIf"><block s="reportNot"><block s="reportEquals"><block var="✐ last set as"/><l>HSL</l></block></block><script><block s="doSetVar"><l>✐ HSL</l><block s="reportMap"><block s="reifyReporter"><autolambda><block s="reportProduct"><l></l><l