use hexColorValue in borders and underlines

This commit is contained in:
Tom Hunkapiller
2021-05-24 08:42:34 +03:00
parent ee105cdb83
commit 097c6a5962
16 changed files with 59 additions and 52 deletions

View File

@ -20,6 +20,7 @@
// <xsd:attribute name="frame" type="s:ST_OnOff" use="optional"/>
// </xsd:complexType>
import { XmlAttributeComponent, XmlComponent } from "file/xml-components";
import { hexColorValue } from "../values";
export interface IBorderOptions {
readonly style: BorderStyle;
@ -29,9 +30,14 @@ export interface IBorderOptions {
}
export class BorderElement extends XmlComponent {
constructor(elementName: string, options: IBorderOptions) {
constructor(elementName: string, { color, ...options }: IBorderOptions) {
super(elementName);
this.root.push(new TableBordersAttributes(options));
this.root.push(
new TableBordersAttributes({
...options,
color: color === undefined ? color : hexColorValue(color),
}),
);
}
}