Survei Riset: Ceritakan pengalaman Anda dengan Blockly
Mulai survei
Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
blockly > Blokir > setColour
Metode Block.setColour()
Mengubah warna blok.
Tanda Tangan:
setColour(colour: number | string): void;
Parameter
Parameter |
Jenis |
Deskripsi |
warna |
angka | {i>string<i} |
Nilai hue HSV (0 hingga 360), string #RRGGBB, atau string referensi pesan yang mengarah ke salah satu dari kedua nilai tersebut. |
Hasil:
void
Kecuali dinyatakan lain, konten di halaman ini dilisensikan berdasarkan Lisensi Creative Commons Attribution 4.0, sedangkan contoh kode dilisensikan berdasarkan Lisensi Apache 2.0. Untuk mengetahui informasi selengkapnya, lihat Kebijakan Situs Google Developers. Java adalah merek dagang terdaftar dari Oracle dan/atau afiliasinya.
Terakhir diperbarui pada 2024-09-10 UTC.
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Informasi yang saya butuhkan tidak ada","missingTheInformationINeed","thumb-down"],["Terlalu rumit/langkahnya terlalu banyak","tooComplicatedTooManySteps","thumb-down"],["Sudah usang","outOfDate","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Masalah kode / contoh","samplesCodeIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 2024-09-10 UTC."],[[["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"]]