使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
blockly >屏蔽 >setColour
Block.setColour() 方法
更改砌块的颜色。
Signature:
setColour(colour: number | string): void;
参数
参数 |
类型 |
说明 |
色彩 |
数字 |字符串 |
HSV 色调值(0 到 360)、#RRGGBB 字符串或指向这两个值之一的消息参考字符串。 |
返回:
void
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-25。
[null,null,["最后更新时间 (UTC):2025-07-25。"],[],["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"],null,[]]