textmode.js / color / TextmodeColor / withAlpha
Method: withAlpha()
ts
withAlpha(alpha): TextmodeColor;Create a copy of this color with a different alpha value.
Useful for creating semi-transparent variations of existing colors without manually copying RGB components.
Parameters
| Parameter | Type | Description |
|---|---|---|
alpha | number | The new alpha value (0-255). Values outside this range will be clamped. |
Returns
A new TextmodeColor instance with the updated alpha.