Answers:
缩短颜色定义:
据记载,可以通过名称,标识符,RGB值或十六进制代码定义颜色。
在大多数情况下,如果您有机会为颜色常数使用标识符,则通常是最短的选择。
另一方面,鲜为人知的事实是,您还可以使用十进制值定义颜色,并且偶尔可以保存字节。
色卡:
+------------------------------------------------------------------------+ +-------------+
| Name | Identifier | RGB | HEX | Decimal | | Best Option |
|------------------------------------------------------------------------| |-------------|
| "BLACK" | [0] | [0,0,0] | 0x000000 | 0 | | 0 |
| "SILVER" | [1] | [192,192,192] | 0xc0c0c0 | 12632256 | | [1] |
| "GRAY"/"GREY" | [2] | [128,128,128] | 0x808080 | 8421504 | | [2] |
| "WHITE" | [3] | [255,255,255] | 0xffffff | 16777215 | | [3] |
| "MAROON" | [4] | [128,0,0] | 0x800000 | 8388608 | | [4] |
| "RED" | [5] | [255,0,0] | 0xff0000 | 16711680 | | [5] |
| "PURPLE" | [6] | [128,0,128] | 0x800080 | 8388736 | | [6] |
| "FUCHSIA"/"MAGENTA" | [7] | [255,0,255] | 0xff00ff | 16711935 | | [7] |
| "GREEN" | [8] | [0,128,0] | 0x008000 | 32768 | | [8] |
| "LIME" | [9] | [0,255,0] | 0x00ff00 | 65280 | | [9] |
| "OLIVE" | [10] | [128,128,0] | 0x808000 | 8421376 | | [10] |
| "YELLOW" | [11] | [255,255,0] | 0xffff00 | 16776960 | | [11] |
| "NAVY" | [12] | [0,0,128] | 0x000080 | 128 | | 128 |
| "BLUE" | [13] | [0,0,255] | 0x0000ff | 255 | | 255 |
| "TEAL" | [14] | [0,128,128] | 0x008080 | 32896 | | [14] |
| "AQUA" | [15] | [0,255,255] | 0x00ffff | 65535 | | [15] |
| "PINK" | [16] | [255,192,203] | 0xffc0cb | 16761035 | | [16] |
| "TOMATO" | [17] | [255,99,71] | 0xff6347 | 16737095 | | [17] |
| "ORANGE" | [18] | [255,165,0] | 0xffa500 | 16753920 | | [18] |
| "GOLD" | [19] | [255,215,0] | 0xffd700 | 16766720 | | [19] |
| "VIOLET" | [20] | [148,0,211] | 0x9400d3 | 9699539 | | [20] |
| "SKYBLUE" | [21] | [135,206,235] | 0x87ceeb | 8900331 | | [21] |
| "CHOCOLATE" | [22] | [210,105,30] | 0xd2691e | 13789470 | | [22] |
| "BROWN" | [23] | [165,42,42] | 0xa52a2a | 10824234 | | [23] |
| "INVISIBLE" | [24] | N/A | N/A | N/A | | [24] |
+------------------------------------------------------------------------+ +-------------+
使用缩写命令:
缩写命令(也称为“短名称”)在徽标的大多数实现中使用。
这是LibreLogo的缩写命令的完整列表。
+-----------------------------------------------+
| Full Command | Short Command | Bytes Saved |
|-----------------------------------------------|
| forward 10 | fd 10 | 5 |
| back 10 | bk 10 | 2 |
| left 90 | lt 90 | 2 |
| right 90 | rt 90 | 3 |
| penup | pu | 3 |
| pendown | pd | 5 |
| position 0 | pos 0 | 5 |
| heading 0 | seth 0 | 3 |
| hideturtle | ht | 8 |
| showturtle | st | 8 |
| clearscreen | cs | 9 |
| pensize 10 | ps 10 | 5 |
| pencolor 0 | pc 0 | 6 |
| fillcolor 0 | fc 0 | 7 |
| picture [ ... ] | pic [ ... ] | 4 |
+-----------------------------------------------+
利用PAGESIZE
您的优势:
PAGESIZE
是一个变量,该变量取决于LibreOffice Writer中的Paper Format(纸张格式),并返回一个包含[width, height]
页面的数组(以磅为单位pt
)。
这在许多情况下都可能有用,但是我个人发现它在不使用数字的情况下生成数字很有用[0-9]
。
https://help.libreoffice.org/Writer/LibreLogo_Toolbar#PAGESIZE
价值图表:
+-------------------------------------------------------------------+
| Paper Format | PAGESIZE |
|-------------------------------------------------------------------|
| A6 | [297.35433070866145, 419.75433070866137] |
| A5 | [419.75433070866137, 595.4456692913386] |
| A4 | [595.4456692913386, 841.6913385826772] |
| A3 | [841.6913385826772, 1190.8913385826772] |
| B6 (ISO) | [354.2456692913386, 498.95433070866136] |
| B5 (ISO) | [498.95433070866136, 708.4913385826771] |
| B4 (ISO) | [708.4913385826771, 1000.8] |
| Letter | [612.0, 792.0] |
| Legal | [612.0, 1008.0] |
| Long Bond | [612.0, 936.0] |
| Tabloid | [792.0, 1224.0] |
| B6 (JIS) | [362.8913385826771, 516.2456692913386] |
| B5 (JIS) | [516.2456692913386, 728.6456692913387] |
| B4 (JIS) | [728.6456692913387, 1031.7543307086614] |
| 16 Kai | [521.2913385826771, 737.2913385826771] |
| 32 Kai | [368.64566929133855, 521.2913385826771] |
| Big 32 Kai | [396.7086614173228, 575.2913385826771] |
| User | CURRENT PAGE SIZE | ← Current Paper Format
| DL Envelope | [311.7543307086614, 623.5086614173229] |
| C6 Envelope | [323.29133858267716, 459.3543307086614] |
| C6/5 Envelope | [323.29133858267716, 649.4456692913386] |
| C5 Envelope | [459.3543307086614, 649.4456692913386] |
| C4 Envelope | [649.4456692913386, 918.7086614173228] |
| #6¾ Envelope | [261.35433070866145, 468.0] |
| #7¾ (Monarch) Envelope | [279.35433070866145, 540.0] |
| #9 Envelope | [279.35433070866145, 639.3543307086613] |
| #10 Envelope | [297.35433070866145, 684.0] |
| #11 Envelope | [324.0, 747.3543307086613] |
| #12 Envelope | [342.0, 792.0] |
| Japanese Postcard | [283.69133858267713, 419.75433070866137] |
+-------------------------------------------------------------------+