File size: 832 Bytes
3ed48fd a812266 3ed48fd |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
import { BaseEffect } from './base.js';
export class MetallicEffect extends BaseEffect {
constructor() {
super();
this.glowOptions = {
color: '#c0c0c0',
blur: 15,
iterations: 10
};
this.strokeOptions = {
color: '#4a4a4a',
width: 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;
}
} |