透過集合功能整理內容
你可以依據偏好儲存及分類內容。
封鎖 >封鎖 >setColour
Block.setColour() 方法
變更建塊的顏色。
Signature:
setColour(colour: number | string): void;
參數
參數 |
類型 |
說明 |
色彩 |
數字 |字串 |
HSV 色調值 (0 到 360)、#RRGGBB 字串,或指向這兩個值之一的訊息參照字串。 |
傳回:
void
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2024-09-10 (世界標準時間)。
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["缺少我需要的資訊","missingTheInformationINeed","thumb-down"],["過於複雜/步驟過多","tooComplicatedTooManySteps","thumb-down"],["過時","outOfDate","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["示例/程式碼問題","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間: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"]]