Try booting a Knoppix v8.6.1 USB stick. I have had some video related issues with Knoppix v9.x so v8.6.1 should be a better test. If Knoppix boots, then you can check the health of the hard drive by using GSmartControl located on the "System Tools" menu of Knoppix's "Start" menu. Feel free to post the complete text report here. If Knoppix will only boot to the command line, then it is also possible to use the command line to check the health of the hard drive, just let me know if this is necessary. FYI, the Mac may appear frozen on the Apple boot picker menu while Knoppix boots so give Knoppix lots of time to boot.
Another quick test would be to remove the hard drive to see if you can then boot to a macOS USB installer or Internet Recovery Mode. Sometimes a failing hard drive will prevent a computer from booting even from external media, although I would think you would have noticed something wrong before this since the computer would have been extremely slow. With an internal drive installed, you would need to use Command + Option + R to force Internet Recovery Mode since Command + R will default to local recovery mode found on the internal drive.
The fading of the video on the display fading to white tends to indicate a hardware issue with the LCD Panel of the built-in Display Assembly, but maybe it is just an Ubuntu thing since I know they have had some video related boot issues in the past...doesn't usually result in fading display AFAIK.
With the 15" & 17" models, you always need to worry about whether the GPU is failing. Unfortunately the GPU failures with these laptops can show up in multiple ways...sometimes without even any visible display issues, plus there is no reliable way to determine if the GPU is failing. Apple tried to create a special service diagnostic, but even that did not detect most GPU failures. Sometimes with macOS you can boot into Safe Mode which may help with some GPU failures. If you can boot macOS, then gfxCardStatus can be used to force the Intel GPU to be used. There is also an NVRAM setting that can be configured to force the laptop to use the Intel GPU instead of the discrete GPU:
https://dosdude1.com/gpudisable/
I have also seen a similar option using a Linux boot disk, but I don't know the Linux command to configure the NVRAM.
Instead of buying a drive for this laptop, you should be able to use an external drive to install macOS or Linux (best to remove the internal drive to keep it from interfering in case it is failing). Installing & booting macOS/Linux on an external drive would help to also eliminate possible issue with the internal hard drive SATA Cable.
I would also consider a possible memory issue. The memory slot nearest the Bottom Case tends to develop cracked solder joints. This is usually easily detected by Option Booting the laptop and letting it sit at the Apple Boot picker menu. Then press on the plastic base of the memory slot and check if the video on screen becomes corrupted and whether the mouse pointer still moves. Also make sure both memory modules are fully latched in place...sometimes the latch can come loose. Or maybe you have a defective memory module.
I'm assuming you have not installed any memory upgrades recently.
You can try using a bootable Memtest86 USB stick to test the memory. If you don't find any errors with the default options, then modify the Memtest86 CPU options to "Sequential" and "Round Robin". I have found these CPU settings tend to detect issues more often & more repeatable at least on the later models....they don't produce any memory errors, but these settings seem to cause Memtest86 to freeze which is just as useful most times since the app is very small meaning either the memory is bad or the Logic Board is bad. Unfortunately the later free versions only allow the test to loop four times...the old v7.5 version can be configured to loop hundreds of times.