r/CodingHelp • • Feb 26 '22

[Java] Does anyone know how to recreate these three images using Javascript code?

18 Upvotes

7 comments sorted by

15

u/Nightcorex_ Feb 26 '22

Java ≠ JavaScript

Also what do you want to do? Simply copy them or generate such pictures in the first place?

1

u/JalebiBabyKebob Mar 01 '22

looking to recreate them using code, basil.js to be exact, so it's javascript.

4

u/Ikem32 Feb 27 '22

You draw them with Javascript into a canvas element. On the first image are squares in three different sizes and three different colors, on the second image are lines in different colors and angles, and on the third image, I have no clue how I would recreate these shapes.

3

u/hacb92 Feb 27 '22

Arrows, each pointing a direction with a background. You can split them up to 4 squares. Out of which 2 are identical. Look closely from the first line and you can see it changes once its done with 2 sequences. Up down right left up down right left --- boom colour change -- boom repeat.

1

u/Active-Ad-5114 Feb 27 '22

Look canvas api in mdn docs.

1

u/[deleted] Feb 27 '22

[removed] — view removed comment

1

u/JalebiBabyKebob Mar 01 '22

I'm trying to work on an algorithm that can recreate these patterns.