diff --git a/nahara-motion/src/system/scene/box2d.ts b/nahara-motion/src/system/scene/box2d.ts index b0daa33..0808027 100644 --- a/nahara-motion/src/system/scene/box2d.ts +++ b/nahara-motion/src/system/scene/box2d.ts @@ -32,7 +32,7 @@ export class Box2D implements ISceneObjectWithPositionalData, ISceneObjectWithSi const height = this.height.get(context.time); const rotation = this.rotation.get(context.time); const color = this.color.get(context.time); - context.canvas.fillStyle = `rgba(${color.r}, ${color.g}, ${color.b}, ${color.a ?? 255})`; + context.canvas.fillStyle = `rgba(${color.r}, ${color.g}, ${color.b}, ${(color.a ?? 255) / 255})`; context.canvas.translate(x + width / 2, y + height / 2); context.canvas.rotate(rotation * Math.PI / 180); diff --git a/nahara-motion/src/system/scene/text2d.ts b/nahara-motion/src/system/scene/text2d.ts index 56d1bf7..d584fff 100644 --- a/nahara-motion/src/system/scene/text2d.ts +++ b/nahara-motion/src/system/scene/text2d.ts @@ -37,7 +37,7 @@ export class Text2D implements ISceneObjectWithPositionalData { const size = this.size.get(context.time); const color = this.color.get(context.time); context.canvas.font = `${size}px ${this.font}`; - context.canvas.fillStyle = `rgba(${color.r}, ${color.g}, ${color.b}, ${color.a ?? 255})`; + context.canvas.fillStyle = `rgba(${color.r}, ${color.g}, ${color.b}, ${(color.a ?? 255) / 255})`; context.canvas.save(); context.canvas.translate(x, y); context.canvas.scale(scaleX, scaleY);