LogoMaker / effects /gold.js
SenY's picture
Init
3ed48fd
raw
history blame
798 Bytes
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;
}
}