Skip to content
Snippets Groups Projects
Commit 1a2de1a0 authored by syuilo's avatar syuilo
Browse files

Merge branch 'develop' of https://github.com/syuilo/misskey into develop

parents 166bc191 83900cbc
No related branches found
No related tags found
No related merge requests found
......@@ -40,7 +40,23 @@ export default Vue.extend({
: this.user.avatarUrl;
},
},
watch: {
'user.avatarBlurhash'() {
this.$el.style.color = this.getBlurhashAvgColor(this.user.avatarBlurhash);
}
},
mounted() {
this.$el.style.color = this.getBlurhashAvgColor(this.user.avatarBlurhash);
},
methods: {
getBlurhashAvgColor(s) {
return typeof s == 'string'
? '#' + [...s.slice(2, 6)]
.map(x => '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz#$%*+,-.:;=?@[]^_{|}~'.indexOf(x))
.reduce((a, c) => a * 83 + c, 0)
.toString(16)
: undefined;
},
onClick(e) {
this.$emit('click', e);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment