#import "sns_polylux_template.typ": * #import "figures.typ": figures, get_figure #import "../lib.typ": pb1-text, pb2-text, pb3-text #import "icons.typ": arrow #import "outlines.typ": theseus-outline, dexhunter-outline, droidra-outline #let pirat-color = ( black: rgb("#000000"), white: rgb("#FFFFFF"), red: rgb("#E33d1C"), blue: rgb("#4AC3CB"), ) #let sns-polylux-template_sns-pirat = ( pirat-color.blue.darken(30%), //rgb("#00728D"), pirat-color.blue.darken(50%), pirat-color.blue.darken(80%), rgb("#AB3502"), rgb("#E69426"), pirat-color.red, ) #let etal = [_et al._] #let eg = [_e.g._] #let highlight-block(body) = { set text(fill: white) block( fill: pirat-color.blue.darken(30%), width: 100%, inset: 8pt, radius: 4pt, body, ) } #let apk-block = block.with( //fill: green.lighten(50%), stroke: black, inset: 10pt, radius: 12pt, ) #let colortest = [ #for th in ( sns-polylux-template_sns-pirat, sns-polylux-template_sns-colormap, sns-polylux-template_unipi-colormap, ) { stack(dir: ltr, ..for c in th { (rect(width: 30pt, height: 30pt, fill: c),) }) } ] #let highlight-color = pirat-color.blue.lighten(40%) /* don't work ? at least for raw block? #let scale-down-to-page(body) = { layout(size => { let size_body = measure(body) let ratio = if size_body.width == 0pt and size_body.height == 0pt { none } else if size_body.width == 0pt { size.height / size_body.height } else if size_body.height == 0pt { size.width / size_body.width } else { let r_x = size.width / size_body.width let r_y = size.height / size_body.height calc.max(r_x, r_y) } if ratio == none or ratio >= 1 { body } else { scale(ratio * 100%, body) } repr(size) linebreak() repr(size_body) linebreak() repr(ratio*100%) }) } */ #let place-fg(x: 0pt, y: 0pt, body) = context { let s = measure(body) let hx = s.width / 2 let hy = s.height / 2 place( bottom + left, dx: x - hx, dy: -y + hy, body ) } #let ghost( img, x: 0pt, y: 0pt, mirror: false, rot: 0deg, height: 100pt ) = { let img = image(img, height: height) if mirror { img = scale(x: -100%, img) } if rot != 0deg { img = rotate(rot, img) } place-fg(x: x, y: y, img) } #let ghost-1 = ghost.with("imgs/ghosts/ghost-1.png") #let ghost-2 = ghost.with("imgs/ghosts/ghost-2.png") #let ghost-3 = ghost.with("imgs/ghosts/ghost-3.png") #let ghost-4 = ghost.with("imgs/ghosts/ghost-4.png") #let ghost-5 = ghost.with("imgs/ghosts/ghost-5.png") #let ghost-6 = ghost.with("imgs/ghosts/ghost-6.png") #let ghost-7 = ghost.with("imgs/ghosts/ghost-7.png") #let eye-1 = ghost.with("imgs/ghosts/eye-1.png") #let eye-2 = ghost.with("imgs/ghosts/eye-2.png") #let eye-3 = ghost.with("imgs/ghosts/eye-3.png") #let eye-4 = ghost.with("imgs/ghosts/eye-4.png")