Skip to main content

Class: ModifyColorHelper

Defined in: src/helper/modify-color-helper.ts:7

Constructors

Constructor

new ModifyColorHelper(): ModifyColorHelper

Returns

ModifyColorHelper

Methods

elementHasBackground()

static elementHasBackground(element): ShapeBackgroundInfo

Defined in: src/helper/modify-color-helper.ts:84

Check if the given element has a background which is non-transparent

Parameters

element

Element

The XML element to check

Returns

ShapeBackgroundInfo

ShapeBackgroundInfo


normalizeColorObject()

static normalizeColorObject(color): Color

Defined in: src/helper/modify-color-helper.ts:68

Bring a Color value into the notation OOXML expects: srgbClr wants 6-digit RRGGBB without a leading #. CSS notations (#abc, rgb(…), named colors) are converted; anything unconvertible falls back to the default gray rather than emitting an invalid attribute value.

Parameters

color

Color

Returns

Color


removeNoFill()

static removeNoFill(): (element) => void

Defined in: src/helper/modify-color-helper.ts:54

Returns

(element) => void


solidFill()

static solidFill(color, index?): (element) => void

Defined in: src/helper/modify-color-helper.ts:13

Replaces or creates an <a:solidFill> Element. The given elelement must be a <p:spPr> or <a:spPr>

Parameters

color

Color

index?

number | "last"

Returns

(element) => void