mirror of
https://github.com/scrtwpns/mixbox.git
synced 2026-03-19 22:49:41 +01:00
add mixbox for javascript
This commit is contained in:
16
javascript/examples/svg.html
Normal file
16
javascript/examples/svg.html
Normal file
@@ -0,0 +1,16 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
</head>
|
||||
<body>
|
||||
<svg width="256" height="256">
|
||||
<rect id="rect" width="256" height="256">
|
||||
</svg>
|
||||
<script src="https://scrtwpns.com/mixbox.js"></script>
|
||||
<script>
|
||||
var color1 = "rgb(0, 33, 133)"; // blue
|
||||
var color2 = "rgb(252, 211, 0)"; // yellow
|
||||
document.getElementById('rect').setAttribute('fill', mixbox.lerp(color1, color2, 0.5));
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user