Post #1751425
2026-04-28 17:41 UTC
Example:
#let stateBubble() = box(
height: 10pt,
baseline: 15%,
circle(
fill: oklch((dto.stateOklchL/100)*100%, dto.stateOklchC, (1deg * dto.stateOklchH))
))
okclh doesn't take floats but ratios and angles. There aren't constructors for these types. You can only get them from string literals...
Replies (1)
-
@gim@queer.group 2026-04-28 17:44
Example: #let padInt(number, targetLen) = { if number >= calc.pow(10, targetLen) [ #str(number) ] else { let n = targetLen let r = number while n > 0 { n = n - 1 let p = calc.pow(10, n) let c = calc.floor(r / p) r = r - (c * p) str(c) } } } There's no function to left pad zeros to an int (or other number types). There isn't a function to cut off decimals either...