Skip to content

Commit

Permalink
Merge pull request #151 from adrlen/dot-color-picked
Browse files Browse the repository at this point in the history
fix: support for color chosen with lowercased palette #150

closes: #150
  • Loading branch information
linx4200 authored Aug 6, 2018
2 parents 904a7f0 + 6933946 commit 16ca183
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/components/Compact.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div class="vc-compact">
<ul class="vc-compact-colors">
<li class="vc-compact-color-item" v-for="c in palette" :key="c"
<li class="vc-compact-color-item" v-for="c in paletteUpperCase(palette)" :key="c"
:aria-label="'color:' + c"
@click="handlerClick(c)"
:class="{'vc-compact-color-item--white': c === '#FFFFFF' }"
Expand Down Expand Up @@ -41,7 +41,7 @@ export default {
},
computed: {
pick () {
return this.colors.hex
return this.colors.hex.toUpperCase()
}
},
methods: {
Expand Down
4 changes: 2 additions & 2 deletions src/components/Grayscale.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div class="vc-grayscale">
<ul class="vc-grayscale-colors">
<li class="vc-grayscale-color-item" v-for="c in palette" :key="c"
<li class="vc-grayscale-color-item" v-for="c in paletteUpperCase(palette)" :key="c"
:aria-label="'color:' + c"
@click="handlerClick(c)"
:class="{'vc-grayscale-color-item--white': c == '#FFFFFF'}"
Expand Down Expand Up @@ -37,7 +37,7 @@ export default {
},
computed: {
pick () {
return this.colors.hex
return this.colors.hex.toUpperCase()
}
},
methods: {
Expand Down
3 changes: 3 additions & 0 deletions src/mixin/color.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@ export default {
if (checked === passed) {
return data
}
},
paletteUpperCase (palette) {
return palette.map(c => c.toUpperCase())
}
}
}

0 comments on commit 16ca183

Please sign in to comment.