Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: support for color chosen with lowercased palette #150 #151

Merged
merged 1 commit into from
Aug 6, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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())
}
}
}