Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function getSkyHue()
- local TIME = game.Lighting:GetMinutesAfterMidnight()
- local TIMES = {0, 300, 330, 360, 390, 1050, 1080, 1100, 1440};
- local C3,V3 = Color3.new,Vector3.new
- local COLORS = {C3(0,0,0),C3(0,0,0),C3(.2,.15,.01),C3(.2,.15,.01),C3(1,1,1),C3(1,1,1),C3(.4,.2,.05),C3(0,0,0),C3(0,0,0)};
- local P0,P1 = 1,#TIMES
- for k,v in pairs(TIMES) do
- if v > TIMES[P0] and v < TIME then P0 = math.max(1,k) end
- if v < TIMES[P1] and v > TIME then P1 = math.min(#TIMES,k) end
- end
- local START,END = TIMES[P0],TIMES[P1]
- if START == END or P0 == P1 then
- return Color3.new()
- end
- local A = math.max(0,math.min(1,(TIME-START)/(END-START)))
- local S,E = COLORS[P0],COLORS[P1]
- local CL = V3(S.r,S.g,S.b):lerp(V3(E.r,E.g,E.b),A)
- return Color3.new(CL.X,CL.Y,CL.Z)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement