[ 3 / biz / cgl / ck / diy / fa / ic / jp / lit / sci / vr / vt ] [ index / top / reports ] [ become a patron ] [ status ]
2023-11: Warosu is now out of extended maintenance.

/sci/ - Science & Math

Search:


View post   

>> No.9588874 [View]
File: 44 KB, 500x500, art.png [View same] [iqdb] [saucenao] [google]
9588874

Challenge:
You will have 3 functions:
getRed(i, j)
getGreen(i, j)
getBlue(i, j)
Where i and j are the xy coordinate where the pixel color will be.
Your goal is to write the code of the 3 functions that will return a number which represent the amount of the given color present in the pixel. You can also change the size of the image.

Here is the html file where all you need is in there: https://pastebin.com/LhxUSFuX

Pic related:
red: return (i + j) & j;
green: return (255 + i - j) & i;
blue: return (i + j) & (255 + i - j);

Show me your best

Navigation
View posts[+24][+48][+96]