UNPKG

pptx-automizer

Version:

A template based pptx generator

30 lines (29 loc) 1.25 kB
import { Color } from '../types/modify-types'; import { ShapeBackgroundInfo, XmlElement } from '../types/xml-types'; export default class ModifyColorHelper { /** * Replaces or creates an <a:solidFill> Element. * The given elelement must be a <p:spPr> or <a:spPr> */ static solidFill: (color: Color, index?: number | 'last') => (element: XmlElement) => void; static removeNoFill: () => (element: XmlElement) => void; static normalizeColorObject: (color: Color) => Color; /** * Check if the given element has a background which is non-transparent * @param element The XML element to check * @returns ShapeBackgroundInfo */ static elementHasBackground(element: XmlElement): ShapeBackgroundInfo; /** * Determines if a scheme color is typically dark and would require light text * @param schemeValue The scheme color value (e.g., 'dk1', 'lt1', 'accent1', etc.) * @returns true if the color is typically dark */ private static isSchemeColorDark; /** * Determines if an RGB color is dark based on luminance * @param rgbValue The RGB hex value (e.g., '000000', 'FF0000') * @returns true if the color is dark */ private static isRgbColorDark; }