Colour Gradient Generator

NME

License: All rights reserved

Fork
1
Fav
0
View
3267
  • Play

Fullscreen

Smart Phone

Fork tree

  • Readme
  • JavaScript 87 lines
  • HTML 2 lines
  • CSS 16 lines
Originally written by Anthony Pace (aka NME), in Toronto, Ontario, Canada. ap13mo@student.ocadu.ca

This is a JS version of the code I originally wrote in AS3 here. http://wonderfl.net/c/r2tR

This was pretty simple, but I was curious to see how this would run in JS, and I hadn't written any JS in a while.

I prefer AS3 to JS, because it's just a better variant of ECMA Script; yet, JS seems to handle this kind of thing (writing to Canvas) fairly well. Chrome executes JS a bit slowly I find, but it's still workable.

My only problem with JS is really just the little things:

E.G. 1: when dealing with bit shifting at 32bit or higher you have to use num>>>x or something similar, whereas, in a language that knows the number is unsigned, you can just write num>>x

E.G. 2: When writing to a buffer, you have to use r,g,b,a,r,g,b,a, etc.... instead of simple using a 24Bit hex value. At the very least, it would be nice to have both options. Also, why does the element have to have an alpha channel? Why not just RGB?

Anyways, as I said, it's the little things with JS that annoy me; yet, it is the little things that add up to make the whole.
  • Colour Gradient Generator
  • Colour Gradient Generator

play

Complete!

Description What kind of game?

Control Device

jsdo.it websocket controller

Mouse

keyboard

smartphone

Fullscreen

NME

Author

I am:

-currently a student at OCAD University. -male. -living in Toronto, -in love with Design, Code, Math, Fine Art & Animation, playing on my classical/Electric guitars, and slamming the keys/experimenting on my old fashioned wall piano.

These code snippets are here to help others, and to refresh my own memory with regard to concepts that are mostly basic, but in some cases intermediate and advanced.

Hopefully these code snippets are commented well enough; yet, if not, and you need help understanding something, let me know.

Default Panel

Size

  • Width: px
  • Height: px

code

QR Code

Discussion

Questions on this code?

Tags

Forked

sort by