mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 19:49:50 +02:00
fix: better coloring
This commit is contained in:
1 parent
b609fcbac7
commit
b6f235efcd
1 file changed
+2
-3
@@ -99,7 +99,6 @@ export function SpacedArmorSceneComponent({
|
|||||||
|
|
||||||
if (props.static) {
|
if (props.static) {
|
||||||
const x = clamp(thickness / props.thicknessRange.quartile, 0, 1);
|
const x = clamp(thickness / props.thicknessRange.quartile, 0, 1);
|
||||||
const y = Math.sqrt(x);
|
|
||||||
|
|
||||||
let color: Color;
|
let color: Color;
|
||||||
let opacity: number;
|
let opacity: number;
|
||||||
@@ -108,12 +107,12 @@ export function SpacedArmorSceneComponent({
|
|||||||
|
|
||||||
switch (props.type) {
|
switch (props.type) {
|
||||||
case ArmorType.Core:
|
case ArmorType.Core:
|
||||||
color = new Color(-((1 - y) ** 2) + 1, -(y ** 2) + 1, 0);
|
color = new Color(-((1 - x) ** 2) + 1, -(x ** 2) + 1, 0);
|
||||||
opacity = 1;
|
opacity = 1;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ArmorType.Spaced:
|
case ArmorType.Spaced:
|
||||||
color = new Color(1 - (7 / 8) * y, 0, 1 - (1 / 8) * y);
|
color = new Color(1 - (7 / 8) * x, 0, 1 - (1 / 8) * x);
|
||||||
opacity = x + 1 / 2;
|
opacity = x + 1 / 2;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user