Skip to content
This repository was archived by the owner on Dec 28, 2025. It is now read-only.

Commit 4c58548

Browse files
committed
Now with more rainbow
1 parent 93135dd commit 4c58548

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

src/scale-builder/script.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,8 @@ function formatRatio(r: Ratio | null): string {
117117
function renderScale() {
118118
render(html`${scaleIntervals.map(n => html`
119119
<button class="note" onClick=${() => removeInterval(n)}
120-
onmouseenter=${() => viewRelative(n)} onmouseleave=${() => viewRelative(0)}>
120+
onmouseenter=${() => viewRelative(n)} onmouseleave=${() => viewRelative(0)}
121+
style="background-color: hsl(${360*n/edo} 80 97);">
121122
${n - relative}
122123
<div class="approx">
123124
${formatRatio(detemper(Math.abs(n - relative)))}
@@ -134,7 +135,8 @@ function renderNonScale() {
134135
complexity(a, scaleIntervals) - complexity(b, scaleIntervals));
135136
render(html`${nonChordIntervals.map(n => html`
136137
<button class="note" onClick=${() => addInterval(n)}
137-
onmouseenter=${() => viewRelative(n)} onmouseleave=${() => viewRelative(0)}>
138+
onmouseenter=${() => viewRelative(n)} onmouseleave=${() => viewRelative(0)}
139+
style="background-color: hsl(${360*n/edo} 80 97);">
138140
${n}
139141
<div class="approx">${formatRatio(detemper(n))}</div>
140142
</button>`)

src/scale-builder/styles.css

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,9 @@
33
border-radius: 0.1rem;
44
margin: 0.2rem;
55
padding: 0.2rem;
6-
background-color: white;
76
width: 3rem;
87
}
98

10-
.note:hover {
11-
background-color: #f0f0f0;
12-
}
13-
149
.approx {
1510
color: gray;
1611
font-size: small;

0 commit comments

Comments
 (0)