The Lite-c way: get the current screen in a bmap using bmap_for_screen(), then check the pixel on the bmap using pixel_for_bmap().
It wont be a very fast function though.
The way you proposes above can't be done in lite-c right away to my knowledge. You need to set normal lite-c code aside and embed the engine in your new application, in either lite-c legacy code or using a plugin in C/C++.
For the hdc window used in that example needs to be the 3dgs hdc window, and you can only retrieve this window by embedding the engine.
If I'm wrong on this one, please correct me!

As an alternative, if you colorpick one static screen or panel, fill an array with pixel values at game start, then read the pixel from there.