Skip to content

Commit

Permalink
Better colors
Browse files Browse the repository at this point in the history
[CI BUILD]
  • Loading branch information
andybak committed Apr 30, 2021
1 parent 4b2ce50 commit 2f93e2a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
10 changes: 10 additions & 0 deletions Assets/Polyhydra/Prefabs/PolyhydraPanel.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -2914,6 +2914,16 @@ PrefabInstance:
m_Modification:
m_TransformParent: {fileID: 3894943745770935112}
m_Modifications:
- target: {fileID: 8240667959069599073, guid: 4c2638b770f13374f82fe34db29dc2bf,
type: 3}
propertyPath: ColorRange
value: 0.8
objectReference: {fileID: 0}
- target: {fileID: 8240667959069599073, guid: 4c2638b770f13374f82fe34db29dc2bf,
type: 3}
propertyPath: ColorOffset
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8240667959069599074, guid: 4c2638b770f13374f82fe34db29dc2bf,
type: 3}
propertyPath: m_RootOrder
Expand Down
8 changes: 5 additions & 3 deletions Assets/Polyhydra/Scripts/VrUiPoly.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using Conway;
using Johnson;
using UnityEngine;
using UnityEngine.Serialization;
using Wythoff;


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

public Gradient colors;

public float ColorRange;
public float ColorOffset;

public ConwayPoly _conwayPoly;
public bool Rescale;
private MeshFilter meshFilter;
Expand All @@ -44,8 +47,7 @@ void Start()
void Init()
{
meshFilter = gameObject.GetComponent<MeshFilter>();
int maxColors = 6; // TODO what should this really be?
previewColors = Enumerable.Range(0, maxColors).Select(x => colors.Evaluate((float)x / maxColors)).ToArray();
previewColors = Enumerable.Range(0,8).Select(x => colors.Evaluate(((x / 8f) * ColorRange + ColorOffset) % 1)).ToArray();
MakePolyhedron();
}

Expand Down

0 comments on commit 2f93e2a

Please sign in to comment.