Skip to content

Commit

Permalink
getChannelColor bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
choptop84 committed Sep 2, 2024
1 parent 4c66934 commit 627ce31
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions editor/ColorConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20200,18 +20200,18 @@ export class ColorConfig {
public static getChannelColor(song: Song, channel: number): ChannelColors {
if (!this.usesColorFormula) {
// Set colors, not defined by formula
if (channel < song.pitchChannelCount) {
if (channel < song.pitchChannelCount) {
return ColorConfig.getComputed("--pitch-channel-limit") == ""
? ColorConfig.pitchChannels[channel % ColorConfig.pitchChannels.length]
: ColorConfig.pitchChannels[channel % (Number(ColorConfig.getComputed("--pitch-channel-limit")) % ColorConfig.pitchChannels.length)];
: ColorConfig.pitchChannels[(channel % Number(ColorConfig.getComputed("--pitch-channel-limit"))) % ColorConfig.pitchChannels.length];
} else if (channel < song.pitchChannelCount + song.noiseChannelCount) {
return ColorConfig.getComputed("--noise-channel-limit") == ""
? ColorConfig.noiseChannels[(channel - song.pitchChannelCount) % ColorConfig.noiseChannels.length]
: ColorConfig.noiseChannels[(channel - song.pitchChannelCount) % (Number(ColorConfig.getComputed("--noise-channel-limit")) % ColorConfig.noiseChannels.length)];
: ColorConfig.noiseChannels[((channel - song.pitchChannelCount) % Number(ColorConfig.getComputed("--noise-channel-limit"))) % ColorConfig.noiseChannels.length];
} else {
return ColorConfig.getComputed("--mod-channel-limit") == ""
? ColorConfig.modChannels[(channel - song.pitchChannelCount - song.noiseChannelCount) % ColorConfig.modChannels.length]
: ColorConfig.modChannels[(channel - song.pitchChannelCount - song.noiseChannelCount) % (Number(ColorConfig.getComputed("--mod-channel-limit")) % ColorConfig.modChannels.length)];
: ColorConfig.modChannels[((channel - song.pitchChannelCount - song.noiseChannelCount) % Number(ColorConfig.getComputed("--mod-channel-limit"))) % ColorConfig.modChannels.length];
}
}
else {
Expand Down

0 comments on commit 627ce31

Please sign in to comment.