LogoMaker / effects /metallic.js
SenY's picture
Init
3ed48fd
raw
history blame contribute delete
834 Bytes
import { BaseEffect } from './base.js';
export class MetallicEffect extends BaseEffect {
constructor() {
super();
this.glowOptions = {
color: '#c0c0c0',
blur: 15,
iterations: 10
};
this.strokeOptions = {
color: '#808080',
width: 1.5
};
}
async setupContext(ctx, options) {
ctx.font = `${options.fontSize}px "${options.font}"`;
ctx.textBaseline = 'top';
// メタリックグラデーションの作成
const gradient = ctx.createLinearGradient(0, 0, 0, ctx.canvas.height);
gradient.addColorStop(0, '#e8e8e8');
gradient.addColorStop(0.5, '#a0a0a0');
gradient.addColorStop(1, '#c0c0c0');
ctx.fillStyle = gradient;
}
}