Skip to content

Commit 2f93e2a

Browse files
committed
Better colors
[CI BUILD]
1 parent 4b2ce50 commit 2f93e2a

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

Assets/Polyhydra/Prefabs/PolyhydraPanel.prefab

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2914,6 +2914,16 @@ PrefabInstance:
29142914
m_Modification:
29152915
m_TransformParent: {fileID: 3894943745770935112}
29162916
m_Modifications:
2917+
- target: {fileID: 8240667959069599073, guid: 4c2638b770f13374f82fe34db29dc2bf,
2918+
type: 3}
2919+
propertyPath: ColorRange
2920+
value: 0.8
2921+
objectReference: {fileID: 0}
2922+
- target: {fileID: 8240667959069599073, guid: 4c2638b770f13374f82fe34db29dc2bf,
2923+
type: 3}
2924+
propertyPath: ColorOffset
2925+
value: 0
2926+
objectReference: {fileID: 0}
29172927
- target: {fileID: 8240667959069599074, guid: 4c2638b770f13374f82fe34db29dc2bf,
29182928
type: 3}
29192929
propertyPath: m_RootOrder

Assets/Polyhydra/Scripts/VrUiPoly.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
using Conway;
55
using Johnson;
66
using UnityEngine;
7+
using UnityEngine.Serialization;
78
using Wythoff;
89

910

@@ -22,7 +23,9 @@ public class VrUiPoly : MonoBehaviour
2223
public int PrismQ;
2324

2425
public Gradient colors;
25-
26+
public float ColorRange;
27+
public float ColorOffset;
28+
2629
public ConwayPoly _conwayPoly;
2730
public bool Rescale;
2831
private MeshFilter meshFilter;
@@ -44,8 +47,7 @@ void Start()
4447
void Init()
4548
{
4649
meshFilter = gameObject.GetComponent<MeshFilter>();
47-
int maxColors = 6; // TODO what should this really be?
48-
previewColors = Enumerable.Range(0, maxColors).Select(x => colors.Evaluate((float)x / maxColors)).ToArray();
50+
previewColors = Enumerable.Range(0,8).Select(x => colors.Evaluate(((x / 8f) * ColorRange + ColorOffset) % 1)).ToArray();
4951
MakePolyhedron();
5052
}
5153

0 commit comments

Comments
 (0)