Double sided gradient, bright in the middle, dim top and bottom
()
| 290 | |
| 291 | /// Double sided gradient, bright in the middle, dim top and bottom |
| 292 | pub fn double_gradient() -> Grid { |
| 293 | let gradient_drop = 1; // Brightness drop between rows |
| 294 | let mut grid = Grid::default(); |
| 295 | for y in 0..(HEIGHT / 2) { |
| 296 | for x in 0..WIDTH { |
| 297 | grid.0[x][y] = (gradient_drop * (y + 1)) as u8; |
| 298 | } |
| 299 | } |
| 300 | for y in (HEIGHT / 2)..HEIGHT { |
| 301 | for x in 0..WIDTH { |
| 302 | grid.0[x][y] = (HEIGHT - gradient_drop * (y + 1)) as u8; |
| 303 | } |
| 304 | } |
| 305 | grid |
| 306 | } |
| 307 | |
| 308 | /// Same as fill_grid_pixels but does each pixel individually |
| 309 | /// So it's much slower because it has to send 306 I2C commands |