Koleksiyonlar ile düzeninizi koruyun
İçeriği tercihlerinize göre kaydedin ve kategorilere ayırın.
blockly > blockRendering > ConstantProvider > getBlockStyleForColour
blockRendering.ConstantProvider.getBlockStyleForColour() yöntemi
Tek bir renk değerine göre bir blok stili alın veya oluşturun. Renge göre stil için bir ad oluşturun.
İmza:
getBlockStyleForColour(colour: string): {
style: BlockStyle;
name: string;
};
Parametreler
Parametre |
Tür |
Açıklama |
renk |
dize |
#RRGGBB renk dizesi. |
İadeler:
{ style: BlockStyle; name: string; }
Stili ve bu stil için otomatik olarak oluşturulan adı içeren bir nesne.
Aksi belirtilmediği sürece bu sayfanın içeriği Creative Commons Atıf 4.0 Lisansı altında ve kod örnekleri Apache 2.0 Lisansı altında lisanslanmıştır. Ayrıntılı bilgi için Google Developers Site Politikaları'na göz atın. Java, Oracle ve/veya satış ortaklarının tescilli ticari markasıdır.
Son güncelleme tarihi: 2025-07-25 UTC.
[[["Anlaması kolay","easyToUnderstand","thumb-up"],["Sorunumu çözdü","solvedMyProblem","thumb-up"],["Diğer","otherUp","thumb-up"]],[["İhtiyacım olan bilgiler yok","missingTheInformationINeed","thumb-down"],["Çok karmaşık / çok fazla adım var","tooComplicatedTooManySteps","thumb-down"],["Güncel değil","outOfDate","thumb-down"],["Çeviri sorunu","translationIssue","thumb-down"],["Örnek veya kod sorunu","samplesCodeIssue","thumb-down"],["Diğer","otherDown","thumb-down"]],["Son güncelleme tarihi: 2025-07-25 UTC."],[],["The `getBlockStyleForColour()` method, part of `blockRendering.ConstantProvider`, creates or retrieves a block style using a provided color string. It accepts a single parameter, `colour`, which is a `#RRGGBB` color string. The method returns an object containing the generated `BlockStyle` and an auto-generated `name` for that style. This allows for dynamically creating and accessing block styles based on color values.\n"]]