Added log image helper function
This commit is contained in:
parent
7dac49f690
commit
98543f60eb
@ -39,3 +39,14 @@ export function toDegrees(angle) {
|
||||
export function lerp(a, b, alpha) {
|
||||
return a * (1 - alpha) + b * alpha;
|
||||
}
|
||||
|
||||
// Console log an image
|
||||
export function logImage(url, width, height) {
|
||||
const style = [
|
||||
"font-size: 1px;",
|
||||
`padding: ${height}px ${width}px;`,
|
||||
`background: url(${url}) no-repeat;`,
|
||||
"background-size: contain;",
|
||||
].join(" ");
|
||||
console.log("%c ", style);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user