So, I have tried looking this up in many places, but have not yet found an answer for my situation.
What I have is a loop, looping for each hour in a day for every day in a year, and, with many insanely ridiculous mathematical equations, getting the angle and distance of the sun at a specific location.
The outcome of the equations gives me a number that I use as an x value to obtain to the image's pixel color at that point. The image is a gradient: when x=0; no sunlight, when x=(1/2)imageWidth; sunrise/sunset, when x=imageWidth; full sunlight.
I had this code working in Processing. Though I would love to just use Processing.js, I am unable to for this project. I am trying to build this with the D3 and Moment libraries.
To the point:
I need to figure out how to pick colors from the pixels of an external (not visible) image, using a value I obtain from equations as the x value of the image.
I have the value I need. I just need help figuring out how to get the color of the pixel of an image that is not visible at the specific x location of that image. I will then use that color as a fill color for a circle.
I realize this may not be worded ideally. It is kind of difficult to lift my head up from writing ridiculous math equations in JavaScript, and then ask questions about obtaining pixel color values of an external image. But, I hope someone out there can help me out!
EDIT: This all will end up as a webpage.