Skip to content

Commit 9b46344

Browse files
Fix range of diffuse colour output ([0,255] not [0,1])
1 parent 7d6d016 commit 9b46344

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -395,9 +395,9 @@ fn main() {
395395
mtl_state.materials[material_name].factor // TODO: sample texture
396396
} else {
397397
Vector::<3>([1f32, 1f32, 1f32])
398-
};
398+
} * 255f32;
399399

400-
println!("<div style=\"position: absolute; transform-origin: 0 0 0; transform: matrix3d({}); width: 0; height: 0; border-top: {:.5}px rgb({:.5}, {:.5}, {:.5}) solid; border-right: {:.5}px transparent solid;\"></div>", matrix, height, diffuse[0], diffuse[1], diffuse[2], width);
400+
println!("<div style=\"position: absolute; transform-origin: 0 0 0; transform: matrix3d({}); width: 0; height: 0; border-top: {:.5}px rgb({:.0}, {:.0}, {:.0}) solid; border-right: {:.5}px transparent solid;\"></div>", matrix, height, diffuse[0], diffuse[1], diffuse[2], width);
401401
}
402402

403403
println!("</div></div></div>");

0 commit comments

Comments
 (0)