def paint.order.pick
import gralha-svg-render@0.1.0.1/svg.bend as Svgimport Base
import gralha-text-scan@0.1.0.1/scan.bend as U
1944# The order from an element's own attribute, else the inherited one as it is.
1945def paint.order.pick(found: Maybe<&2, String>, +inherited: U32) -> U32:
1946 match found:
1947 case None{}: inherited
1948 case Some{v}:
1949 +vv = v
1950 +k = style.keyword(vv)
1951 U.choose(U32, U32.is_eq(k, 1) || U32.is_eq(k, 3), inherited, U.choose(U32, U32.is_eq(k, 2), 0, paint.order.value(vv, inherited)))