@@ -43,15 +43,18 @@ function Viewport( editor ) {
43
43
44
44
// helpers
45
45
46
+ const GRID_COLORS_LIGHT = [ 0x999999 , 0x777777 ]
47
+ const GRID_COLORS_DARK = [ 0x555555 , 0x888888 ] ;
48
+
46
49
const grid = new THREE . Group ( ) ;
47
50
48
- const grid1 = new THREE . GridHelper ( 30 , 30 , 0x888888 ) ;
49
- grid1 . material . color . setHex ( 0x888888 ) ;
51
+ const grid1 = new THREE . GridHelper ( 30 , 30 ) ;
52
+ grid1 . material . color . setHex ( GRID_COLORS_LIGHT [ 0 ] ) ;
50
53
grid1 . material . vertexColors = false ;
51
54
grid . add ( grid1 ) ;
52
55
53
- const grid2 = new THREE . GridHelper ( 30 , 6 , 0x222222 ) ;
54
- grid2 . material . color . setHex ( 0x222222 ) ;
56
+ const grid2 = new THREE . GridHelper ( 30 , 6 ) ;
57
+ grid2 . material . color . setHex ( GRID_COLORS_LIGHT [ 1 ] ) ;
55
58
grid2 . material . vertexColors = false ;
56
59
grid . add ( grid2 ) ;
57
60
@@ -330,14 +333,14 @@ function Viewport( editor ) {
330
333
mediaQuery . addEventListener ( 'change' , function ( event ) {
331
334
332
335
renderer . setClearColor ( event . matches ? 0x333333 : 0xaaaaaa ) ;
333
- updateGridColors ( grid1 , grid2 , event . matches ? [ 0x222222 , 0x888888 ] : [ 0x888888 , 0x282828 ] ) ;
336
+ updateGridColors ( grid1 , grid2 , event . matches ? GRID_COLORS_DARK : GRID_COLORS_LIGHT ) ;
334
337
335
338
render ( ) ;
336
339
337
340
} ) ;
338
341
339
342
renderer . setClearColor ( mediaQuery . matches ? 0x333333 : 0xaaaaaa ) ;
340
- updateGridColors ( grid1 , grid2 , mediaQuery . matches ? [ 0x222222 , 0x888888 ] : [ 0x888888 , 0x282828 ] ) ;
343
+ updateGridColors ( grid1 , grid2 , mediaQuery . matches ? GRID_COLORS_DARK : GRID_COLORS_LIGHT ) ;
341
344
342
345
}
343
346
0 commit comments