JohnEarnest / ok

An open-source interpreter for the K5 programming language.
MIT License
587 stars 72 forks source link

Explaine iKe's bitmap a bit more #18

Closed refi64 closed 9 years ago

refi64 commented 9 years ago

The bitmap is a matrix of indices into the palette.

I have no clue what the heck this is supposed to mean.

JohnEarnest commented 9 years ago

A matrix is a list of lists in which each inner list has the same length- a "rectangular" array.

The palette is a list of colors (DOM colors that a browser can understand, like #FFCA74, represented as strings).

The numbers in the matrix are the indices of colors in the palette- that is, each number in the matrix corresponds to the position of a color in the palette. Conceptually iKe evaluates palette@bitmap and then renders the resulting matrix as a rectangular image, one pixel per matrix element.

I invite you to refer to some of the example programs.

refi64 commented 9 years ago

The numbers in the matrix are the indices of colors in the palette- that is, each number in the matrix corresponds to the position of a color in the palette. Conceptually iKe evaluates palette@bitmap and then renders the resulting matrix as a rectangular image, one pixel per matrix element.

Ahh...this is the part I didn't get. It might be worth adding this longer explanation to iKe's README.

Also, I did read some of the examples. It didn't help. :)