Skip to content

Commit

Permalink
Editor: Improved outliner coloring.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrdoob committed Jun 18, 2020
1 parent 06c3353 commit 53c8f13
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 25 deletions.
36 changes: 14 additions & 22 deletions editor/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -188,10 +188,22 @@ textarea, input { outline: none; } /* osx */
content: '●';
}

/* */

#outliner .Scene {
color: #ccccff;
color: #8888dd;
}

#outliner .Camera {
color: #dd8888;
}

#outliner .Light {
color: #dddd88;
}

/* */

#outliner .Object3D {
color: #aaaaee;
}
Expand All @@ -214,32 +226,12 @@ textarea, input { outline: none; } /* osx */

/* */

#outliner .PointLight {
color: #dddd00;
}

/* */

#outliner .Geometry {
color: #88ff88;
}

#outliner .BoxGeometry {
color: #bbeebb;
}

#outliner .TorusGeometry {
color: #aaeeaa;
}

/* */

#outliner .Material {
color: #ff8888;
}

#outliner .MeshPhongMaterial {
color: #ffaa88;
color: #eeaaee;
}

/* */
Expand Down
19 changes: 16 additions & 3 deletions editor/js/Sidebar.Scene.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,17 +86,30 @@ function SidebarScene( editor ) {

}

function getObjectType( object ) {

if ( object.isScene ) return 'Scene';
if ( object.isCamera ) return 'Camera';
if ( object.isLight ) return 'Light';
if ( object.isMesh ) return 'Mesh';
if ( object.isLine ) return 'Line';
if ( object.isPoints ) return 'Points';

return 'Object3D';

}

function buildHTML( object ) {

var html = `<span class="type ${ object.type }"></span> ${ escapeHTML( object.name ) }`;
var html = `<span class="type ${ getObjectType( object ) }"></span> ${ escapeHTML( object.name ) }`;

if ( object.isMesh ) {

var geometry = object.geometry;
var material = object.material;

html += ` <span class="type ${ geometry.type }"></span> ${ escapeHTML( geometry.name ) }`;
html += ` <span class="type ${ material.type }"></span> ${ escapeHTML( getMaterialName( material ) ) }`;
html += ` <span class="type Geometry"></span> ${ escapeHTML( geometry.name ) }`;
html += ` <span class="type Material"></span> ${ escapeHTML( getMaterialName( material ) ) }`;

}

Expand Down

0 comments on commit 53c8f13

Please sign in to comment.