Better avgColor

This commit is contained in:
syuilo 2019-04-17 17:13:49 +09:00
parent 17f35174ea
commit 5eec896615
No known key found for this signature in database
GPG key ID: BDC4C49D06AB9D69
3 changed files with 3 additions and 5 deletions

View file

@ -121,7 +121,7 @@ export default Vue.extend({
if (this.file.properties.avgColor) {
anime({
targets: this.$refs.thumbnail,
backgroundColor: this.file.properties.avgColor.replace('255)', '0)'),
backgroundColor: 'transparent', // TODO fade
duration: 100,
easing: 'linear'
});

View file

@ -142,7 +142,7 @@ export default Vue.extend({
if (this.file.properties.avgColor) {
anime({
targets: this.$refs.thumbnail,
backgroundColor: this.file.properties.avgColor.replace('255)', '0)'),
backgroundColor: 'transparent', // TODO fade
duration: 100,
easing: 'linear'
});

View file

@ -363,9 +363,7 @@ export default async function(
logger.debug(`average color is calculated: ${r}, ${g}, ${b}`);
const value = info.isOpaque ? `rgba(${r},${g},${b},0)` : `rgba(${r},${g},${b},255)`;
properties['avgColor'] = value;
properties['avgColor'] = `rgb(${r},${g},${b})`;
} catch (e) { }
};