mirror of
https://github.com/typst/typst
synced 2025-05-17 18:45:28 +08:00
- Identifiers are now evaluated as variables instead of being plain values - Constants like `left` or `bold` are stored as dynamic values containing the respective rust types - We now distinguish between arrays and dictionaries to make things more intuitive (at the cost of a bit more complex parsing) - Spans were removed from collections (arrays, dictionaries), function arguments still have spans for the top-level values to enable good diagnostics
24 lines
571 B
XML
24 lines
571 B
XML
// Test the `rgb` function.
|
|
|
|
// Check the output.
|
|
[rgb 0.0, 0.3, 0.7]
|
|
|
|
// Alpha channel.
|
|
[rgb 1.0, 0.0, 0.0, 0.5]
|
|
|
|
// Value smaller than 0.0 and larger than 1.0
|
|
[rgb -30, 15.5, 0.5]
|
|
|
|
// Missing blue component.
|
|
[rgb 0, 1]
|
|
|
|
// Missing all components.
|
|
[rgb]
|
|
|
|
// warning: 10:6-10:9 must be between 0.0 and 1.0
|
|
// warning: 10:11-10:15 must be between 0.0 and 1.0
|
|
// error: 13:6-13:10 missing argument: blue component
|
|
// error: 16:5-16:5 missing argument: red component
|
|
// error: 16:5-16:5 missing argument: green component
|
|
// error: 16:5-16:5 missing argument: blue component
|