mirror of
https://codeberg.org/yeentown/barkey
synced 2024-11-26 21:33:01 +00:00
Better avgColor
This commit is contained in:
parent
17f35174ea
commit
5eec896615
3 changed files with 3 additions and 5 deletions
|
@ -121,7 +121,7 @@ export default Vue.extend({
|
||||||
if (this.file.properties.avgColor) {
|
if (this.file.properties.avgColor) {
|
||||||
anime({
|
anime({
|
||||||
targets: this.$refs.thumbnail,
|
targets: this.$refs.thumbnail,
|
||||||
backgroundColor: this.file.properties.avgColor.replace('255)', '0)'),
|
backgroundColor: 'transparent', // TODO fade
|
||||||
duration: 100,
|
duration: 100,
|
||||||
easing: 'linear'
|
easing: 'linear'
|
||||||
});
|
});
|
||||||
|
|
|
@ -142,7 +142,7 @@ export default Vue.extend({
|
||||||
if (this.file.properties.avgColor) {
|
if (this.file.properties.avgColor) {
|
||||||
anime({
|
anime({
|
||||||
targets: this.$refs.thumbnail,
|
targets: this.$refs.thumbnail,
|
||||||
backgroundColor: this.file.properties.avgColor.replace('255)', '0)'),
|
backgroundColor: 'transparent', // TODO fade
|
||||||
duration: 100,
|
duration: 100,
|
||||||
easing: 'linear'
|
easing: 'linear'
|
||||||
});
|
});
|
||||||
|
|
|
@ -363,9 +363,7 @@ export default async function(
|
||||||
|
|
||||||
logger.debug(`average color is calculated: ${r}, ${g}, ${b}`);
|
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'] = `rgb(${r},${g},${b})`;
|
||||||
|
|
||||||
properties['avgColor'] = value;
|
|
||||||
} catch (e) { }
|
} catch (e) { }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue