Algorithm of a table to make a colorcoded picture

Hello Guys,
i need help by creating an algorithm to make a colorcoded picture with this table:

Range of green values Assigned color
0-30 Black
31-50 Dark Blue
51-70 Purple
71-90 Red
91-110 Orange
111-130 Magenta
131-150 Pink
151-180 Light Green
181-210 Yellow
211-230 Light Blue
231-255 White

Thanks for help :smiley:

Do you want to learn how to do this or just be given a solution?

the solution please ;D

are these the colors you want?

well, I made this block

only problem, it's super slow
Link: Snap! Build Your Own Blocks

The slowness comes from the biggness of ur sprite
You should have a pixel sprite for a color

alonzo also takes a while (albet, not as long). Also, the block is supposed to be used for any costume. I posted my script so someone else could optimize it.

Your use for this weird function is mysterious
If it is from a weird teacher u can ignore him
If ur curious then maybe use a map

yes they are

Gang, I think we should refrain from doing people's homework for them. It's fine to make suggestions, but not to give finished code.

Well, they didn't mention it was for school until after I created a (slow) solution.

You're supposed to figure it out from the dorkiness of the problem! ;~P

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.