turtlestitch/libraries/setrgb.xml

1 wiersz
2.1 KiB
XML

<blocks app="Snap! 5.0, http://snap.berkeley.edu" version="1"><block-definition s="set pen color to r: %&apos;r&apos; g: %&apos;g&apos; b: %&apos;b&apos;" type="command" category="pen"><header></header><code></code><translations>pt:altera a cor da tua caneta para vermelho _ , verde _ e azul _ (0 a 255)&#xD;</translations><inputs><input type="%n">255</input><input type="%n">0</input><input type="%n">0</input></inputs><script><block s="doRun"><block s="reportJSFunction"><list><l>r</l><l>g</l><l>b</l></list><l>this.setColor(new Color(r, g, b));</l></block><list><block var="r"/><block var="g"/><block var="b"/></list></block></script></block-definition><block-definition s="set pen color to h: %&apos;h&apos; s: %&apos;s&apos; v: %&apos;v&apos;" type="command" category="pen"><header></header><code></code><translations>pt:altera a cor da caneta para matiz _ , saturação _ e brilho _ (0 a 1)&#xD;</translations><inputs><input type="%n">0.3</input><input type="%n">0.7</input><input type="%n">0.6</input></inputs><script><block s="doRun"><block s="reportJSFunction"><list><l>h</l><l>s</l><l>v</l></list><l>var col = new Color();&#xD;col.set_hsv(h, s, v);&#xD;this.setColor(col);</l></block><list><block var="h"/><block var="s"/><block var="v"/></list></block></script></block-definition><block-definition s="RGB color" type="reporter" category="pen"><header></header><code></code><translations>pt:a cor da caneta em RGB (vermelho, verde e azul; 0 a 255)&#xD;</translations><inputs></inputs><script><block s="doReport"><block s="evaluate"><block s="reportJSFunction"><list><l></l></list><l>return new List([this.color.r, this.color.g, this.color.b]);</l></block><list></list></block></block></script></block-definition><block-definition s="HSV color" type="reporter" category="pen"><header></header><code></code><translations>pt:a cor da caneta em HSV (matiz, saturação e brilho, 0 a 1)&#xD;</translations><inputs></inputs><script><block s="doReport"><block s="evaluate"><block s="reportJSFunction"><list><l></l></list><l>return new List(this.color.hsv());</l></block><list></list></block></block></script></block-definition></blocks>