Module

font/utils

@ckeditor/ckeditor5-font/src/utils

module

Filtering

Constants

Type Definitions

Functions

  • addColorSelectorToDropdown( options = { options.colorPickerLabel, options.colorPickerViewConfig, options.colors, options.columns, [options.documentColorsCount], [options.documentColorsLabel], options.dropdownView, options.removeButtonLabel } ) → ColorSelectorView

    A helper that adds ColorSelectorView to the color dropdown with proper initial values.

    Parameters

    options : object

    Configuration options

    Properties
    options.colorPickerLabel : string

    The label for the color picker button.

    options.colorPickerViewConfig : false | ColorPickerViewConfig

    Configuration of the color picker view.

    options.colors : Array<ColorDefinition>

    An array with definitions representing colors to be displayed in the color selector.

    options.columns : number

    The number of columns in the color grid.

    [ options.documentColorsCount ] : number

    The number of document colors inside the dropdown.

    [ options.documentColorsLabel ] : string

    The label for the section with document colors.

    options.dropdownView : ColorSelectorDropdownView

    The dropdown view to which a ColorSelectorView will be added.

    options.removeButtonLabel : string

    The label for the button responsible for removing the color.

    Returns

    ColorSelectorView

    The new color selector view.

  • buildDefinition( modelAttributeKey, options ) → FontConverterDefinition

    Builds a proper converter definition out of input data.

    Parameters

    modelAttributeKey : string
    options : Array<FontFamilyOption> | Array<FontSizeOption>

    Returns

    FontConverterDefinition
  • renderDowncastElement( styleAttr ) → ( modelAttributeValue: string, __namedParameters: DowncastConversionApi ) => AttributeElement

    A font color and font background color helper responsible for downcasting a color attribute to a <span> element.

    Note: The styleAttr parameter should be either 'color' or 'background-color'.

    Parameters

    styleAttr : string

    Returns

    ( modelAttributeValue: string, __namedParameters: DowncastConversionApi ) => AttributeElement
  • renderUpcastAttribute( styleAttr ) → ( viewElement: Element ) => string

    A font color and font background color helper responsible for upcasting data to the model.

    Note: The styleAttr parameter should be either 'color' or 'background-color'.

    Parameters

    styleAttr : string

    Returns

    ( viewElement: Element ) => string