Skip to content

Commit

Permalink
feat: full ch strip graphic eq - better colors
Browse files Browse the repository at this point in the history
  • Loading branch information
olzzon authored and olzzon committed Oct 28, 2020
1 parent f4e63b0 commit abf4e10
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion client/assets/css/ChanStripFull.css
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
justify-content: space-evenly;
top: 5px;
left: 2px;
height: 200px;
height: 150px;
width: 1500px;
margin-left: 150px;
margin-top: 10px;
Expand Down
16 changes: 8 additions & 8 deletions client/components/ChanStripFull.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,15 @@ interface IChanStripFullProps {
}

enum EqColors {
'yellow',
'green',
'blue',
'red',
'rgb(93, 184, 180)',
'rgb(53, 112, 127)',
'rgb(217, 21, 133)',
'rgb(229, 159, 34)',
}

// Constant for calculation Eq dot positions:
const MIN_HZ = 20
const MAX_HZ = 20000
const EQ_MIN_HZ = 20
const EQ_MAX_HZ = 20000
const EQ_X_SIZE = 140
const EQ_WIN_X = 450
const EQ_X_OFFSET = 350
Expand Down Expand Up @@ -167,12 +167,12 @@ class ChanStripFull extends React.PureComponent<

valueToFreqPosition(value: number) {
return (
EQ_X_SIZE * (Math.log2(value * (MAX_HZ - MIN_HZ) + MIN_HZ) - 1) - EQ_WIN_X
EQ_X_SIZE * (Math.log2(value * (EQ_MAX_HZ - EQ_MIN_HZ) + EQ_MIN_HZ) - 1) - EQ_WIN_X
)
}
freqPositionToValue(position: number) {
let newFreq = Math.pow(2, (position + EQ_WIN_X - EQ_X_OFFSET) / EQ_X_SIZE + 1)
return ((newFreq - MIN_HZ) / (MAX_HZ - MIN_HZ))
return ((newFreq - EQ_MIN_HZ) / (EQ_MAX_HZ - EQ_MIN_HZ))
}

eq() {
Expand Down

0 comments on commit abf4e10

Please sign in to comment.