🚧 Working on themes
This commit is contained in:
parent
4f39f5e357
commit
ccd95c612d
12 changed files with 241 additions and 25 deletions
|
@ -1,14 +1,18 @@
|
|||
import { PatternConfig, PatternOption } from './types'
|
||||
import { Part } from './part'
|
||||
import { Renderer } from './renderer'
|
||||
import { Svg } from './svg'
|
||||
import { Option } from './option'
|
||||
import themes from './themes'
|
||||
import { Theme } from './themes/theme'
|
||||
|
||||
export class Pattern {
|
||||
config: PatternConfig;
|
||||
svg: Svg = new Svg();
|
||||
parts: {
|
||||
[index: string]: Part;
|
||||
}
|
||||
options: {[propName: string]: number};
|
||||
themes: {[index:string]: Theme} = themes;
|
||||
|
||||
constructor(config: PatternConfig) {
|
||||
this.config = config;
|
||||
|
@ -31,8 +35,8 @@ export class Pattern {
|
|||
throw Error('You have to implement the draft() method in your Pattern instance.');
|
||||
}
|
||||
|
||||
render(pattern: Pattern): string {
|
||||
let r = new Renderer();
|
||||
return r.render(pattern);
|
||||
render(): string {
|
||||
let svg = new Svg();
|
||||
return svg.render(this);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue