Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
api:colors:zh [2022/08/11 10:24]
fight_xing created
api:colors:zh [2023/11/29 05:57] (current)
hfsr [Colors(颜色) API]
Line 1: Line 1:
-Colors API+Colors(颜色) ​API
 ========= =========
-This "API" serves a global table that allows you to refer to colors by their name, instead of their associated ID/number. The table serves as a look-up in both directions, so for example ​`colors.blue` ​has the value `11`, whereas ​`colors[11]` ​has the string value `blue`. These are the defined colors:+此“API”提供了一个全局列表,让你能够以名称调用颜色,而无需以对应编号调用。此表可以双向查询。例如,`colors.blue`的值为`11`,而`colors[11]`的值为字符串`blue`。   
 +下表为所定义的颜色:
  
-White (`white`), Number: ​+白色 ​(`white`),编号:
-Orange ​(`orange`), Number: ​+橙色 ​(`orange`),编号:
-Magenta ​(`magenta`), Number: ​+品红色 ​(`magenta`),编号:
-Light Blue (`lightblue`), Number: ​+淡蓝色 ​(`lightblue`),编号:
-Yellow ​(`yellow`), Number: ​+黄色 ​(`yellow`),编号:
-Lime (`lime`), Number: ​+黄绿色 ​(`lime`),编号:
-Pink (`pink`), Number: ​+粉红色 ​(`pink`),编号:
-Gray (`gray`), Number: ​+灰色 ​(`gray`),编号:
-Silver ​(`silver`), Number: ​+淡灰色 ​(`silver`),编号:
-Cyan (`cyan`), Number: ​+青色 ​(`cyan`),编号:
-Purple ​(`purple`), Number: ​10 +紫色 ​(`purple`),编号:10 
-Blue (`blue`), Number: ​11 +蓝色 ​(`blue`),编号:11 
-Brown (`brown`), Number: ​12 +棕色 ​(`brown`),编号:12 
-Green (`green`), Number: ​13 +绿色 ​(`green`),编号:13 
-Red (`red`), Number: ​14 +红色 ​(`red`),编号:14 
-Black (`black`), Number: ​15+黑色 ​(`black`),编号:15
  
-Note that the indexing starts at zero, not one.+请注意编号从0而不是1开始。 
 + 
 +此表在你需要设置或读取集束红石线缆中信号的时候很有用,例如:
  
-Useful for setting or getting bundled redstone output or input, for example: 
 ```lua ```lua
 local component = require("​component"​) local component = require("​component"​)
Line 29: Line 31:
 rs.setBundledOutput(sides.back,​ colors.green,​ rs.getBundledInput(sides.front,​ colors.blue)) rs.setBundledOutput(sides.back,​ colors.green,​ rs.getBundledInput(sides.front,​ colors.blue))
 ``` ```
-would output the back signal strength to the front.+会将后方的信号强度输出到前方。
  
-Contents+目录
 ----------- -----------
 {{page>​api:​contents:​zh&​noheader&​noeditbutton&​nouser&​nofooter}} {{page>​api:​contents:​zh&​noheader&​noeditbutton&​nouser&​nofooter}}