typst/tests/typ/compiler
frozolotl b0e81d4b3f
Remove restrictions to chroma and improve clamping (#2690)
This PR does a few small things:
- Oklab's a*/b* and Oklch's chroma components can be as large as desired.
- In PDF, when encoding Oklab, the range is widened from [-0.4,0.4] to [-0.5,0.5].
- In PDF, clamping is now performed on Oklch's chroma instead of a* and b*.
  This causes hue not to be distorted when clamping.

SVG and PNG export remain unchanged:
- SVG itself never had any restrictions on chroma.
  We directly use the `oklab` and `oklch` CSS colors, which should work fine for the most part.
  In the future, embedded ICC profiles might be nice. Further research is likely necessary.
- While PNG does not support color spaces like Oklab or Oklch, certain useful features exist.
  One can define gamma (gAMA) and chromacities&whitepoint (cHRM) chunks and even embed ICC profiles.
  While `image` crate does not support these features for encoding, its backend crate `png` does support gAMA and cHRM.
  It does not allow embedding ICC profiles yet, though.

As it stands, to fully support wide gamuts and more accurate colors, more work is necessary.
This PR should help a bit though.
2023-11-17 10:41:45 +01:00
..
modules New import syntax 2023-01-03 12:32:17 +01:00
array.typ Fix error priority for function arguments 2023-10-27 15:38:08 +02:00
bench.typ New default style 2023-02-25 20:04:30 +01:00
block.typ Update tests for type system changes 2023-09-11 14:42:43 +02:00
break-continue.typ Check for control flow event before let binding (#1912) 2023-08-21 16:21:37 +02:00
bytes.typ Add capability to get current compiler version (#2016) 2023-10-02 20:28:19 +02:00
call.typ Update tests for type system changes 2023-09-11 14:42:43 +02:00
closure.typ Fix missing capturing of assignments 2023-09-16 20:41:44 +02:00
color.typ Remove restrictions to chroma and improve clamping (#2690) 2023-11-17 10:41:45 +01:00
comment.typ Update tests for type system changes 2023-09-11 14:42:43 +02:00
construct.typ Renaming and refactoring 2023-03-19 22:39:19 +01:00
content-field.typ Support indices preceding the base symbol, revamping #699 (#825) 2023-04-25 11:24:07 +02:00
dict.typ Implement dict key interpolation (#2559) 2023-11-02 17:08:08 +01:00
duration.typ Duration type, simple date-duration-calculations and comparisons (#1843) 2023-08-30 12:28:53 +02:00
embedded-expr.typ Add hints for invalid identifier errors (#2583) 2023-11-07 12:14:20 +01:00
field.typ Update tests for type system changes 2023-09-11 14:42:43 +02:00
for.typ Update tests for type system changes 2023-09-11 14:42:43 +02:00
highlight.typ Fix highlighting of identifiers before brackets 2023-04-11 17:26:00 +02:00
hint.typ Add hints for invalid identifier errors (#2583) 2023-11-07 12:14:20 +01:00
if.typ Update tests for type system changes 2023-09-11 14:42:43 +02:00
import.typ Update tests for type system changes 2023-09-11 14:42:43 +02:00
include.typ Give more specific error messages (#881) 2023-04-19 13:26:55 +02:00
label.typ Fix field access on styled element 2023-05-22 13:49:09 +02:00
let.typ Update tests for type system changes 2023-09-11 14:42:43 +02:00
methods.typ Make Oklab and Oklch chroma ratios relative to 0.4 (#2642) 2023-11-13 15:48:54 +01:00
module.typ Interpret methods on modules as functions in modules 2023-01-23 13:26:10 +01:00
ops-assoc.typ Reorganize library and tests 2022-11-29 14:18:13 +01:00
ops-invalid.typ Improve "cannot apply '{+,-}'" error messages (#2510) 2023-10-29 11:15:53 +01:00
ops-prec.typ Rework delimiter errors 2023-05-24 16:58:51 +02:00
ops.typ Handle compiler panics when handling infinite lengths (#2215) 2023-09-28 11:15:09 +02:00
packages.typ Allow packages to specify their minimum compiler version 2023-09-04 16:29:57 +02:00
plugin-oob.typ Avoid plugin panics (#2232) 2023-09-26 16:21:21 +02:00
plugin.typ Update tests for type system changes 2023-09-11 14:42:43 +02:00
recursion.typ Update tests for type system changes 2023-09-11 14:42:43 +02:00
repr-color-gradient.typ Implement Oklch support (#2611) 2023-11-10 10:31:06 +01:00
repr.typ Gradient Part 2 - Linear gradients (#2279) 2023-10-03 19:31:02 +02:00
return.typ Prevent silent swallowing of return expressions trailing arguments (#2545) 2023-11-06 21:42:38 +01:00
selector-logical.typ Support selectors with and/or followed by before/after (#1883) 2023-08-22 12:23:55 +02:00
set.typ Reintroduce `--root` 2023-06-28 10:36:53 +02:00
shorthand.typ Add tests for shorthand (#2660) 2023-11-13 11:54:48 +01:00
show-bare.typ Fix show rule colon error message 2023-03-21 13:08:18 +01:00
show-node.typ Update tests for type system changes 2023-09-11 14:42:43 +02:00
show-recursive.typ Reorganize library and tests 2022-11-29 14:18:13 +01:00
show-selector.typ Update tests for type system changes 2023-09-11 14:42:43 +02:00
show-text.typ Fix crashing on empty regexps (#1870) 2023-08-08 14:42:04 +02:00
spread.typ Update tests for type system changes 2023-09-11 14:42:43 +02:00
string.typ Add test for ends-with fix 2023-08-30 17:19:25 +02:00
type-compatibility.typ Type compatibility 2023-09-11 17:38:03 +02:00
while.typ Update tests for type system changes 2023-09-11 14:42:43 +02:00