mirror of
https://github.com/gristlabs/grist-core.git
synced 2024-10-27 20:44:07 +00:00
20 lines
527 B
TypeScript
20 lines
527 B
TypeScript
|
export interface Style {
|
||
|
textColor?: string;
|
||
|
fillColor?: string;
|
||
|
}
|
||
|
|
||
|
export class CombinedStyle implements Style {
|
||
|
public readonly textColor?: string;
|
||
|
public readonly fillColor?: string;
|
||
|
constructor(rules: Style[], flags: any[]) {
|
||
|
for (let i = 0; i < rules.length; i++) {
|
||
|
if (flags[i]) {
|
||
|
const textColor = rules[i].textColor;
|
||
|
const fillColor = rules[i].fillColor;
|
||
|
this.textColor = textColor || this.textColor;
|
||
|
this.fillColor = fillColor || this.fillColor;
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|