dicom-microscopy-viewer-changed
Version:
Interactive web-based viewer for DICOM Microscopy Images
28 lines (27 loc) • 843 B
HTML
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Test</title>
</head>
<body>
<h1>MooColor</h1>
<div id="target" style="display:inline-block;padding:1em;font-size:2em;cursor:pointer;user-select: none;">Click me</div>
<script src="../dist/moo-color.js"></script>
<script>
(function () {
const t = document.querySelector('#target');
t.addEventListener('click', () => {
const color = new window.MooColor.MooColor.random({
black: [0, 70],
white: 30,
});
t.style.backgroundColor = color.toRgb();
t.style.color = color.brightness > 165 ? '#222' : '#fff';
});
})();
</script>
</body>
</html>