Skip to content

Commit

Permalink
add comment to coloring snippet to make intention clearer
Browse files Browse the repository at this point in the history
  • Loading branch information
biasmv committed Jun 23, 2015
1 parent 7b1252c commit 4d2d7a9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions doc/coloring.rst
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ The following will add a new color operation which colors atoms based on their i
function evenOdd() {
return new pv.color.ColorOp(function(atom, out, index) {
// index + 0, index + 1 etc. are the positions in the output array
// at which the red (+0), green (+1), blue (+2) and alpha (+3)
// components are to be written.
if (atom.index() % 2 === 0) {
out[index+0] = 1.0; out[index+1] = 0.0;
out[index+2] = 0.0; out[index+3] = 1.0;
Expand Down

0 comments on commit 4d2d7a9

Please sign in to comment.