Skip to content

Commit

Permalink
minor color improve
Browse files Browse the repository at this point in the history
  • Loading branch information
teamdoug committed Feb 27, 2021
1 parent 03bf5e3 commit 27d5bdd
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -1537,38 +1537,37 @@ class App extends React.Component {
collapseTimes,
collapseLengths
) {
let baseS = 71.9,
baseL = 4;
let baseL = 5;
let targetH, targetS, targetL;
if (mass <= collapseMass) {
let ratio = Math.log(mass) / Math.log(collapseMass);
targetH = 29.6 + ratio * (9.9-29.6);
targetS = 87.1;
targetL = 19.6;
baseL = baseL * (1 + 0.1 * ratio);
baseL = baseL * (1 + 0.2 * ratio);
} else if (mass <= yellowCollapseMass) {
let ratio = Math.log(mass / collapseMass) / Math.log(yellowCollapseMass / collapseMass);
targetH = 9.9 + ratio * (64.6 - 9.9);
targetS = 87.1 + ratio * (90.1 - 87.1);
targetL = 19.6 + ratio * (75.7 - 19.6);
baseL = baseL * (1.1 + 0.1 * ratio)
baseL = baseL * (1.2 + 0.2 * ratio)
} else if (mass <= whiteCollapseMass) {
let ratio = Math.log(mass / yellowCollapseMass) / Math.log(whiteCollapseMass/yellowCollapseMass);
targetH = 64.6 + ratio * (64.6-64.6);
targetS = 90.1 + ratio * (0-90.1);
targetL = 75.7 + ratio * (95.6-75.7);
baseL = baseL * (1.2 + 0.1 * ratio)
baseL = baseL * (1.4 + 0.2 * ratio)
}else if (mass <= blueCollapseMass) {
let ratio = Math.log(mass / whiteCollapseMass) / Math.log(blueCollapseMass/whiteCollapseMass);
targetH = 228.6;
targetS = 0 + ratio * (72.8-0);
targetL = 95.6 + ratio * (72.8-95.6);
baseL = baseL * (1.3 + 0.1 * ratio)
baseL = baseL * (1.6 + 0.2 * ratio)
} else {
targetH = 228.6;
targetS = 72.8
targetL = 72.8
baseL = 1.4
baseL = 1.8
}
let intensity = colorFrame / 5;
if (colorFrame >= 5) {
Expand Down

0 comments on commit 27d5bdd

Please sign in to comment.