diff options
| author | Laurenz <laurmaedje@gmail.com> | 2021-06-30 22:32:24 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-06-30 22:32:24 +0200 |
| commit | 17e89468847735df10381c47c46c7d82d33cc463 (patch) | |
| tree | b0ce55f7d62aac399717aac3ab5a76c981c66f65 /tests | |
| parent | 911b5818344e85a58da9db895a333d22484b7ae7 (diff) | |
Remove color literals (#39)
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/typ/code/array.typ | 2 | ||||
| -rw-r--r-- | tests/typ/code/repr.typ | 2 | ||||
| -rw-r--r-- | tests/typ/insert/circle.typ | 6 | ||||
| -rw-r--r-- | tests/typ/insert/ellipse.typ | 2 | ||||
| -rw-r--r-- | tests/typ/insert/rect.typ | 14 | ||||
| -rw-r--r-- | tests/typ/insert/square.typ | 4 | ||||
| -rw-r--r-- | tests/typ/layout/grid-1.typ | 24 | ||||
| -rw-r--r-- | tests/typ/layout/grid-3.typ | 4 | ||||
| -rw-r--r-- | tests/typ/layout/pad.typ | 2 | ||||
| -rw-r--r-- | tests/typ/layout/stack.typ | 2 | ||||
| -rw-r--r-- | tests/typ/text/decorations.typ | 13 | ||||
| -rw-r--r-- | tests/typ/text/font.typ | 2 | ||||
| -rw-r--r-- | tests/typ/utility/color.typ | 13 |
13 files changed, 45 insertions, 45 deletions
diff --git a/tests/typ/code/array.typ b/tests/typ/code/array.typ index c9383501..002a792a 100644 --- a/tests/typ/code/array.typ +++ b/tests/typ/code/array.typ @@ -15,7 +15,7 @@ // Multiple lines and items and trailing comma. {("1" - , #002 + , rgb("002") ,)} // Error: 3 expected closing paren diff --git a/tests/typ/code/repr.typ b/tests/typ/code/repr.typ index eacbf8e8..3da86bf8 100644 --- a/tests/typ/code/repr.typ +++ b/tests/typ/code/repr.typ @@ -34,7 +34,7 @@ --- // Colors. -{#f7a20500} +#rgb("f7a20500") --- // Strings and escaping. diff --git a/tests/typ/insert/circle.typ b/tests/typ/insert/circle.typ index 1c8808a4..fbb45435 100644 --- a/tests/typ/insert/circle.typ +++ b/tests/typ/insert/circle.typ @@ -4,7 +4,7 @@ // Test auto sizing. Auto-sized circle. \ -#circle(fill: #eb5278)[ +#circle(fill: rgb("eb5278"))[ #align!(center, center) But, soft! ] @@ -28,9 +28,9 @@ Expanded by height. --- // Test relative sizing. -#rect(width: 100%, height: 50pt, fill: #aaa)[ +#rect(width: 100%, height: 50pt, fill: rgb("aaa"))[ #align!(center, center) - #font!(color: #fff) + #font!(color: white) #circle(radius: 10pt, fill: eastern)[A] #circle(height: 60%, fill: eastern)[B] #circle(width: 20% + 20pt, fill: eastern)[C] diff --git a/tests/typ/insert/ellipse.typ b/tests/typ/insert/ellipse.typ index a086ab74..29f9b556 100644 --- a/tests/typ/insert/ellipse.typ +++ b/tests/typ/insert/ellipse.typ @@ -2,7 +2,7 @@ --- 100% rect in 100% ellipse in fixed rect. \ -#rect(width: 3cm, height: 2cm, fill: #2a631a)[ +#rect(width: 3cm, height: 2cm, fill: rgb("2a631a"))[ #ellipse!(width: 100%, height: 100%, fill: forest) #rect!(width: 100%, height: 100%, fill: conifer) #align!(center, center) diff --git a/tests/typ/insert/rect.typ b/tests/typ/insert/rect.typ index 93df071b..7f6bb899 100644 --- a/tests/typ/insert/rect.typ +++ b/tests/typ/insert/rect.typ @@ -9,19 +9,19 @@ #rect(fill: conifer)[Textbox] // Empty with fixed width and height. -#rect(width: 3cm, height: 12pt, fill: #CB4CED) +#rect(width: 3cm, height: 12pt, fill: rgb("CB4CED")) // Fixed width, text height. -#rect(width: 2cm, fill: #9650D6, pad(5pt)[Fixed and padded]) +#rect(width: 2cm, fill: rgb("9650D6"), pad(5pt)[Fixed and padded]) // Page width, fixed height. -#rect(height: 1cm, width: 100%, fill: #734CED)[Topleft] +#rect(height: 1cm, width: 100%, fill: rgb("734CED"))[Topleft] // Not visible, but creates a gap between the boxes above and below // due to line spacing. -#rect(width: 1in, fill: #ff0000) +#rect(width: 1in, fill: rgb("ff0000")) // These are in a row! -#rect(width: 0.5in, height: 10pt, fill: #D6CD67) -#rect(width: 0.5in, height: 10pt, fill: #EDD466) -#rect(width: 0.5in, height: 10pt, fill: #E3BE62) +#rect(width: 0.5in, height: 10pt, fill: rgb("D6CD67")) +#rect(width: 0.5in, height: 10pt, fill: rgb("EDD466")) +#rect(width: 0.5in, height: 10pt, fill: rgb("E3BE62")) diff --git a/tests/typ/insert/square.typ b/tests/typ/insert/square.typ index 4dd8964f..f9efb98e 100644 --- a/tests/typ/insert/square.typ +++ b/tests/typ/insert/square.typ @@ -5,7 +5,7 @@ Auto-sized square. \ #square(fill: eastern)[ #align!(center) #pad!(5pt) - #font!(color: #fff, weight: bold) + #font!(color: white, weight: bold) Typst ] @@ -13,7 +13,7 @@ Auto-sized square. \ // Length wins over width and height. // Error: 2:9-2:20 unexpected argument // Error: 1:22-1:34 unexpected argument -#square(width: 10cm, height: 20cm, length: 1cm, fill: #eb5278) +#square(width: 10cm, height: 20cm, length: 1cm, fill: rgb("eb5278")) --- // Test height overflow. diff --git a/tests/typ/layout/grid-1.typ b/tests/typ/layout/grid-1.typ index 2938a7f2..ad55b53f 100644 --- a/tests/typ/layout/grid-1.typ +++ b/tests/typ/layout/grid-1.typ @@ -6,18 +6,18 @@ #page!(width: 100pt, height: 140pt) #grid( columns: (auto, 1fr, 3fr, 0.25cm, 3%, 2mm + 10%), - rect(0.5cm, #2a631a), + rect(0.5cm, rgb("2a631a")), rect(100%, forest), rect(100%, conifer), - rect(100%, #ff0000), - rect(100%, #00ff00), - rect(80%, #00faf0), - rect(1cm, #00ff00), - rect(0.5cm, #2a631a), + rect(100%, rgb("ff0000")), + rect(100%, rgb("00ff00")), + rect(80%, rgb("00faf0")), + rect(1cm, rgb("00ff00")), + rect(0.5cm, rgb("2a631a")), rect(100%, forest), rect(100%, conifer), - rect(100%, #ff0000), - rect(100%, #00ff00), + rect(100%, rgb("ff0000")), + rect(100%, rgb("00ff00")), ) #grid() @@ -29,7 +29,7 @@ gutter-rows: (1fr,), rect(fill: eastern)[dddaa aaa aaa], rect(fill: conifer)[ccc], - rect(width: 100%, fill: #dddddd)[aaa], + rect(width: 100%, fill: rgb("dddddd"))[aaa], ) --- @@ -38,11 +38,11 @@ columns: (1fr, 1cm, 1fr, 1fr), column-dir: ttb, rows: (auto, 1fr), - rect(height: 100%, fill: #222222)[foo], - rect(height: 100%, fill: #547d0a)[bar], + rect(height: 100%, fill: rgb("222222"))[foo], + rect(height: 100%, fill: rgb("547d0a"))[bar], rect(height: 100%, fill: eastern)[hab], rect(height: 100%, fill: conifer)[baz], - rect(height: 100%, width: 100%, fill: #547d0a)[bar], + rect(height: 100%, width: 100%, fill: rgb("547d0a"))[bar], ) --- diff --git a/tests/typ/layout/grid-3.typ b/tests/typ/layout/grid-3.typ index 62af4072..38572520 100644 --- a/tests/typ/layout/grid-3.typ +++ b/tests/typ/layout/grid-3.typ @@ -67,9 +67,9 @@ columns: 2 * (1fr,), rows: (1fr, 2fr, auto, 1fr, 1cm), gutter-rows: 4 * (10pt,), - rect(height: 100%, width: 100%, fill: #ff0000)[No height], + rect(height: 100%, width: 100%, fill: rgb("ff0000"))[No height], [foo], - rect(height: 100%, width: 100%, fill: #fc0030)[Still no height], + rect(height: 100%, width: 100%, fill: rgb("fc0030"))[Still no height], [bar], [The nature of being itself is in question. Am I One? Am I Many? What is being alive?], [baz], diff --git a/tests/typ/layout/pad.typ b/tests/typ/layout/pad.typ index 05f9b359..d43cafc5 100644 --- a/tests/typ/layout/pad.typ +++ b/tests/typ/layout/pad.typ @@ -7,7 +7,7 @@ // All sides together. #rect(fill: conifer)[ #pad!(10pt, right: 20pt) - #rect(width: 20pt, height: 20pt, fill: #eb5278) + #rect(width: 20pt, height: 20pt, fill: rgb("eb5278")) ] // Error: 13-23 missing argument: body diff --git a/tests/typ/layout/stack.typ b/tests/typ/layout/stack.typ index 89e587c7..fd5201df 100644 --- a/tests/typ/layout/stack.typ +++ b/tests/typ/layout/stack.typ @@ -3,7 +3,7 @@ --- #let rect(width, color) = rect(width: width, height: 1cm, fill: color) #stack( - rect(2cm, #2a631a), + rect(2cm, rgb("2a631a")), rect(3cm, forest), rect(1cm, conifer), ) diff --git a/tests/typ/text/decorations.typ b/tests/typ/text/decorations.typ index 3e298ece..247178b2 100644 --- a/tests/typ/text/decorations.typ +++ b/tests/typ/text/decorations.typ @@ -3,17 +3,14 @@ --- #strike[Statements dreamt up by the utterly deranged.] -Sometimes, we work #strike(extent: 5%, strength: 10pt)[in secret]. -There might be #strike(extent: 5%, strength: 10pt, color: #abcdef88)[redacted] -things. +Sometimes, we work #strike(extent: 5%, strength: 10pt)[in secret]. There might +be #strike(extent: 5%, strength: 10pt, color: rgb("abcdef88"))[redacted] things. --- -#underline(color: #fc0030)[Critical information is conveyed here.] -#underline[ - Still important, but not #underline(strength: 0pt)[mission ]critical. -] +#underline(color: rgb("fc0030"))[Critical information is conveyed here.] +#underline[Still important, but not #underline(strength: 0pt)[mission ]critical.] -#font(color: #fc0030, underline[Change with the wind.]) +#font(color: rgb("fc0030"), underline[Change with the wind.]) --- #overline(underline[Running amongst the wolves.]) diff --git a/tests/typ/text/font.typ b/tests/typ/text/font.typ index d6161c81..9bfeb684 100644 --- a/tests/typ/text/font.typ +++ b/tests/typ/text/font.typ @@ -30,7 +30,7 @@ Emoji: 🐪, 🌋, 🏞 ] // Colors. -#font(color: eastern)[This is #font(color: #FA644B)[way more] colorful.] +#font(color: eastern)[This is #font(color: rgb("FA644B"))[way more] colorful.] --- // Test top and bottom edge. diff --git a/tests/typ/utility/color.typ b/tests/typ/utility/color.typ index 2e40828b..6523a08d 100644 --- a/tests/typ/utility/color.typ +++ b/tests/typ/utility/color.typ @@ -2,18 +2,21 @@ // Ref: false --- -// Check the output. -#test(rgb(0.0, 0.3, 0.7), #004db3) +// Compare both ways. +#test(rgb(0.0, 0.3, 0.7), rgb("004db3")) // Alpha channel. -#test(rgb(1.0, 0.0, 0.0, 0.5), #ff000080) +#test(rgb(1.0, 0.0, 0.0, 0.5), rgb("ff000080")) // Warning: 2:11-2:14 should be between 0.0 and 1.0 // Warning: 1:16-1:20 should be between 0.0 and 1.0 -#test(rgb(-30, 15.5, 0.5), #00ff80) +#test(rgb(-30, 15.5, 0.5), rgb("00ff80")) // Error: 11-15 missing argument: blue component -#test(rgb(0, 1), #00ff00) +#test(rgb(0, 1), rgb("00ff00")) + +// Error: 11-16 invalid color +#test(rgb("lol"), error) // Error: 3:11-3:11 missing argument: red component // Error: 2:11-2:11 missing argument: green component |
