This repository has been archived by the owner on Sep 3, 2021. It is now read-only.
Replies: 2 comments
-
Change colour according to CPU and GPU temperature (for AIDA64 users) - fallback to Hue Wheel if AIDA is not running--Variables you can change
--depends on your cooling, marks start and end of color wheel
local Tmax=83
local Tmin=40
local aida_delay=3000 -- delay between steps
local aida_saturation=1
local aida_brightness=1
-- fallback is Hue Wheel
local fallback_delay=500 -- delay between steps
local fallback_saturation=0.95
local fallback_brightness=1
-- Stuff you might not want to change
Lighting.SetStepDuration(511)
Lighting.SetFlashingSpeed(0)
Lighting.SetBreathingModeEnabled(false)
local fallback_i=0 -- internal variable
local fallback_colour_step=1.01 -- internal variable, probably better to leave it alone but whatever
while true do
-- if aida is running it displays cpu and gpu temperature sensitive colour
if(Aida64.IsInstalledAndRunning()) then
local T1=Aida64.GetSensorValue('TCPU')
local T2=Aida64.GetSensorValue('TGPU1DIO') -- FIXME: might crash if GPU1 doesn't exist? does this count IGPs?
local T=((((T1+T2)/2)-Tmin)/(Tmax-Tmin))
if(T>1) then
T=1
elseif(T<0) then
T=0
end
local r, g, b = Lighting.ColourUtils.HSVtoRGB((1.666-T)%1, aida_saturation, aida_brightness)
r = tonumber(("%x"):format(r * 15), 16)
g = tonumber(("%x"):format(g * 15), 16)
b = tonumber(("%x"):format(b * 15), 16)
Lighting.BatchBegin()
for i = 1, 8 do
Lighting.SetColour(i, r, g, b)
end
Lighting.BatchEnd()
os.sleep(aida_delay)
--if aida isn't running it does colour wheel
else
local r, g, b = Lighting.ColourUtils.HSVtoRGB((i % 98.0) / 98.0, fallback_saturation, fallback_brightness)
r = tonumber(("%x"):format(r * 15), 16)
g = tonumber(("%x"):format(g * 15), 16)
b = tonumber(("%x"):format(b * 15), 16)
Lighting.BatchBegin()
for i = 1, 8 do
Lighting.SetColour(i, r, g, b)
end
Lighting.BatchEnd()
os.sleep(fallback_delay)
i = i + fallback_colour_step
end
end from @btd5 [missing video demo] |
Beta Was this translation helpful? Give feedback.
0 replies
-
Thanks a lot, bro! I’ll try to understand it a little bit deeper and maybe I’ll do smth by myself with ur helpful info in the last letter.
Best wishes from Russia!
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am creating this topic so that people can share custom scripts with each other, for example, if they are too lazy to write their own :D
Beta Was this translation helpful? Give feedback.
All reactions