研究调查问卷:请告诉我们您使用 Blockly 的体验
开始调查问卷
blockly >屏蔽 >setColour
Block.setColour() 方法
更改砌块的颜色。
Signature:
setColour(colour: number | string): void;
参数
参数 |
类型 |
说明 |
色彩 |
数字 |字符串 |
HSV 色调值(0 到 360)、#RRGGBB 字符串或指向这两个值之一的消息参考字符串。 |
返回:
void
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2024-09-10。
[null,null,["最后更新时间 (UTC):2024-09-10。"],[[["The `Block.setColour()` method is used to change the color of a block in Blockly."],["You can specify the color using an HSV hue value (0-360), a hexadecimal color code (#RRGGBB), or a message reference string."],["Calling this method does not return any value (void)."]]],["The `Block.setColour()` method modifies a block's color. It accepts a single `colour` parameter, which can be a numeric HSV hue value (0-360), an HTML-style hexadecimal color code (`#RRGGBB`), or a string referencing one of those two. The method does not return any value (void). This allows for dynamic color changes within the block interface using different color formats.\n"]]