diff --git a/core/field.ts b/core/field.ts index 5821b7938..4c5058464 100644 --- a/core/field.ts +++ b/core/field.ts @@ -683,13 +683,18 @@ export abstract class Field implements IASTNodeLocationSvg, } /** - * Updates the field to match the colour/style of the block. Should only be - * called by BlockSvg.applyColour(). + * Updates the field to match the colour/style of the block. * - * @internal + * Non-abstract sub-classes may wish to implement this if the colour of the + * field depends on the colour of the block. It will automatically be called + * at relevant times, such as when the parent block or renderer changes. + * + * See {@link + * https://developers.google.com/blockly/guides/create-custom-blocks/fields/customizing-fields/creating#matching_block_colours + * | the field documentation} for more information, or FieldDropdown for an + * example. */ applyColour() {} - // Non-abstract sub-classes may wish to implement this. See FieldDropdown. /** * Used by getSize() to move/resize any DOM elements, and get the new size. diff --git a/core/field_colour.ts b/core/field_colour.ts index 87c34b99d..de07ca839 100644 --- a/core/field_colour.ts +++ b/core/field_colour.ts @@ -177,8 +177,6 @@ export class FieldColour extends Field { /** * Updates text field to match the colour/style of the block. - * - * @internal */ override applyColour() { if (!this.getConstants()!.FIELD_COLOUR_FULL_BLOCK) { diff --git a/core/field_dropdown.ts b/core/field_dropdown.ts index d4ade38bc..6836e5754 100644 --- a/core/field_dropdown.ts +++ b/core/field_dropdown.ts @@ -431,8 +431,6 @@ export class FieldDropdown extends Field { /** * Updates the dropdown arrow to match the colour/style of the block. - * - * @internal */ override applyColour() { const style = (this.sourceBlock_ as BlockSvg).style; diff --git a/core/field_input.ts b/core/field_input.ts index e14e2df32..3a0faf063 100644 --- a/core/field_input.ts +++ b/core/field_input.ts @@ -201,8 +201,6 @@ export abstract class FieldInput extends Field { /** * Updates text field to match the colour/style of the block. - * - * @internal */ override applyColour() { if (!this.sourceBlock_ || !this.getConstants()!.FULL_BLOCK_FIELDS) return;