Skip to content

Commit

Permalink
Merge pull request #12 from qlik-oss/DEB-257/ColorPicker
Browse files Browse the repository at this point in the history
ColorPicker picking correct color
  • Loading branch information
AlbertBackenhof authored Jun 27, 2019
2 parents 6e9031b + a4d56a3 commit 2b2f523
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/definition.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ define([], function () {
component: "color-picker",
dualOutput: true,
defaultValue: {
index: 6,
color: null
index: -1,
color: "#4477aa"
},
show: (a) => !a.color.auto
},
Expand Down
7 changes: 6 additions & 1 deletion src/theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,12 @@ class ThemeManager {

static colorFromTheme(index) {
if (typeof ThemeManager.qlikTheme != 'undefined') {
return ThemeManager.qlikTheme.properties.palettes.ui[0].colors[index - 1];
const colors = ThemeManager.qlikTheme.properties.palettes.ui[0].colors;
let i = index;
if (colors[0] !== "none") {
i--;
}
return ThemeManager.qlikTheme.properties.palettes.ui[0].colors[i];
} else {
return colors[index];
}
Expand Down

0 comments on commit 2b2f523

Please sign in to comment.