01 Fragments and data
Components: pick, reorder, repeat
The same three numbers, in a different order, make a different colour.
ExerciseEdit code
Write a new order: swap green and red
Runs once per pixelDrag numbers, or edit the code
JS side
color.r takes the first number; .bgr reorders; .rrr repeats a component. rgb and xyz are two names for the same components.
Try it
- Switch between the three orders
- Rewrite .bgr as .grb