File size: 798 Bytes
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 GoldEffect extends BaseEffect {
    constructor() {
        super();
        this.glowOptions = {
            color: '#ffd700',
            blur: 15,
            iterations: 10
        };
        this.strokeOptions = {
            color: '#b8860b',
            width: 2
        };
    }

    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, '#ffd700');
        gradient.addColorStop(0.5, '#ffb700');
        gradient.addColorStop(1, '#ffd700');
        ctx.fillStyle = gradient;
    }
}