Skip to content

Commit

Permalink
normalize theme properties with url properties, fix paths for lint/to…
Browse files Browse the repository at this point in the history
…do tasks
  • Loading branch information
imsky committed Oct 15, 2015
1 parent a870a22 commit 7a11076
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 17 deletions.
8 changes: 7 additions & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ var build = generateBuild();
gulp.task('jshint', function() {
return gulp.src([
'src/lib/*.js',
'src/lib/renderers/*.js',
'src/renderers/*.js',
'src/index.js'
])
Expand All @@ -40,7 +41,12 @@ gulp.task('jshint', function() {
});

gulp.task('todo', function() {
return gulp.src('src/index.js')
return gulp.src([
'src/lib/*.js',
'src/lib/renderers/*.js',
'src/renderers/*.js',
'src/index.js'
])
.pipe(todo())
.pipe(gulp.dest('./'));
});
Expand Down
32 changes: 16 additions & 16 deletions src/lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -217,28 +217,28 @@ var App = {
stylenodes: 'head link.holderjs',
themes: {
'gray': {
background: '#EEEEEE',
foreground: '#AAAAAA'
bg: '#EEEEEE',
fg: '#AAAAAA'
},
'social': {
background: '#3a5a97',
foreground: '#FFFFFF'
bg: '#3a5a97',
fg: '#FFFFFF'
},
'industrial': {
background: '#434A52',
foreground: '#C2F200'
bg: '#434A52',
fg: '#C2F200'
},
'sky': {
background: '#0D8FDB',
foreground: '#FFFFFF'
bg: '#0D8FDB',
fg: '#FFFFFF'
},
'vine': {
background: '#39DBAC',
foreground: '#1E292C'
bg: '#39DBAC',
fg: '#1E292C'
},
'lava': {
background: '#F8591A',
foreground: '#1C2846'
bg: '#F8591A',
fg: '#1C2846'
}
}
},
Expand Down Expand Up @@ -307,11 +307,11 @@ function parseURL(url, instanceOptions) {
// Colors

if (options.bg) {
holder.theme.background = utils.parseColor(options.bg);
holder.theme.bg = utils.parseColor(options.bg);
}

if (options.fg) {
holder.theme.foreground = utils.parseColor(options.fg);
holder.theme.fg = utils.parseColor(options.fg);
}

//todo: add automatic foreground to themes without foreground
Expand Down Expand Up @@ -666,7 +666,7 @@ function buildSceneGraph(scene) {
var Shape = sceneGraph.Shape;

var holderBg = new Shape.Rect('holderBg', {
fill: scene.theme.background
fill: scene.theme.bg
});

holderBg.resize(scene.width, scene.height);
Expand All @@ -681,7 +681,7 @@ function buildSceneGraph(scene) {
};
}

var holderTextColor = scene.theme.foreground;
var holderTextColor = scene.theme.fg;

if (scene.flags.autoFg) {
var holderBgColor = new Color(holderBg.properties.fill);
Expand Down

0 comments on commit 7a11076

Please sign in to comment.