Make planar foreground colors different from bought color

This commit is contained in:
thepaperpilot 2023-05-18 16:45:33 -05:00
parent 3657cfb810
commit 6769a236f1
2 changed files with 9 additions and 5 deletions

View file

@ -96,7 +96,7 @@ export function createPlane(
for (let i = 0; i < 12; i++) random(); for (let i = 0; i < 12; i++) random();
const name = getName(random); const name = getName(random);
const color = getColor([0.64, 0.75, 0.55], random); const color = getColor([0.56, 0.74, 0.73], random);
const background = getColor([0.18, 0.2, 0.25], random); const background = getColor([0.18, 0.2, 0.25], random);
const resource = createResource<DecimalSource>(0, getName(random)); const resource = createResource<DecimalSource>(0, getName(random));
const timeActive = persistent<DecimalSource>(0); const timeActive = persistent<DecimalSource>(0);
@ -487,7 +487,7 @@ export function createPlane(
break; break;
case "conversion": { case "conversion": {
const prestigeResource = createResource(0, getName(random)); const prestigeResource = createResource(0, getName(random));
const prestigeColor = getColor([0.64, 0.75, 0.55], random); const prestigeColor = getColor([0.56, 0.74, 0.73], random);
const cost = nextCost.value; const cost = nextCost.value;
const costExponent = random() / 2 + 0.25; // Random from 0.25 - 0.75 const costExponent = random() / 2 + 0.25; // Random from 0.25 - 0.75
const effectExponent = random() / 2 + 0.25; // ditto const effectExponent = random() / 2 + 0.25; // ditto
@ -660,7 +660,7 @@ export function createPlane(
); );
previousGain = costFormula.evaluate(); previousGain = costFormula.evaluate();
n.value += 2; n.value += 2;
const barColor = getColor([0.64, 0.75, 0.55], random); const barColor = getColor([0.56, 0.74, 0.73], random);
const bar = createBar(() => ({ const bar = createBar(() => ({
direction: Direction.Right, direction: Direction.Right,
width: 300, width: 300,
@ -719,7 +719,7 @@ export function createPlane(
case "dimensions": { case "dimensions": {
const title = getPowerName(random); const title = getPowerName(random);
const energy = createResource<DecimalSource>(0, title + " energy"); const energy = createResource<DecimalSource>(0, title + " energy");
const energyColor = getColor([0.64, 0.75, 0.55], random); const energyColor = getColor([0.56, 0.74, 0.73], random);
const currentN = n.value; const currentN = n.value;
const prevGain = previousGain; const prevGain = previousGain;
costFormula = costFormula.add( costFormula = costFormula.add(

View file

@ -329,7 +329,11 @@ export function getPowerName(random: () => number) {
export function getColor(base: [number, number, number], random: () => number) { export function getColor(base: [number, number, number], random: () => number) {
const [h, s, v] = rgb2hsv(...base); const [h, s, v] = rgb2hsv(...base);
const [r, g, b] = hsv2rgb(Math.floor(random() * 360), s, v); let newH = Math.floor(random() * 320);
if (newH > h - 20) {
newH += 40;
}
const [r, g, b] = hsv2rgb(newH, s, v);
return `rgb(${r * 255}, ${g * 255}, ${b * 255})`; return `rgb(${r * 255}, ${g * 255}, ${b * 255})`;
} }