Skip to content

Commit

Permalink
colorize music too
Browse files Browse the repository at this point in the history
  • Loading branch information
MinaciousGrace committed Dec 21, 2016
1 parent f712c4f commit e87a356
Showing 1 changed file with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,16 @@ end
local function getMSDColor (diff)
if diff then
return HSV(math.max(95 - (diff/40)*150, -50), 0.9, 0.9)
end;
end
return HSV(0, 0.9, 0.9)
end

local function getMusicColor (length)
if length then
return HSV(math.max(95 - (length/600)*150, -50), 0.9, 0.9)
end
return HSV(0, 0.9, 0.9)
end;
end

t[#t+1] = Def.Actor{
SetCommand=function(self)
Expand Down Expand Up @@ -390,7 +397,7 @@ t[#t+1] = LoadFont("Common Large") .. {
local playabletime = steps:GetTimingData():GetElapsedTimeFromBeat(song:GetLastBeat()) - steps:GetTimingData():GetElapsedTimeFromBeat(song:GetFirstBeat())
playabletime = playabletime / getCurRateValue()
self:settext(SecondsToMMSS(playabletime))
self:diffuse(getSongLengthColor(playabletime))
self:diffuse(getMusicColor(playabletime))
else
self:settext("")
end
Expand Down

0 comments on commit e87a356

Please sign in to comment.