Skip to content

Commit 3fb585c

Browse files
committed
[remove] redundant quantum-circuit.color
1 parent dee836d commit 3fb585c

File tree

4 files changed

+4
-13
lines changed

4 files changed

+4
-13
lines changed

docs/guide/quill-guide.typ

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -279,13 +279,12 @@ The #ref-fn("quantum-circuit()") command provides several options for styling th
279279
```
280280
)
281281

282-
The `wire`, `color` and `fill` options provide means to customize line strokes and colors. This allows us to easily create "dark-mode" circuits:
282+
The `wire` and `fill` options provide means to customize line strokes and colors. This allows us to easily create "dark-mode" circuits:
283283

284284
#example(
285285
```typ
286286
#box(fill: black, quantum-circuit(
287-
wire: .7pt + white, // Wire and stroke color
288-
color: white, // Default foreground and text color
287+
wire: .7pt + white, // Wire, stroke, and text color
289288
fill: black, // Gate fill color
290289
1, $X$, ctrl(1), rstick([*?*]), [\ ],
291290
1,1, targ(), meter(),

src/draw-functions.typ

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@
104104
}
105105

106106
#let draw-ctrl(gate, draw-params) = {
107-
let color = utility.if-auto(gate.fill, draw-params.color)
107+
let color = utility.if-auto(gate.fill, draw-params.wire.paint)
108108
if "show-dot" in gate.data and not gate.data.show-dot { return none }
109109
if gate.data.open {
110110
let stroke = utility.update-stroke(draw-params.wire, gate.stroke)

src/quantum-circuit.typ

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,6 @@
4848
/// -> bool
4949
equal-row-heights: false,
5050

51-
/// Foreground color, default for strokes, text, controls etc. If you want
52-
/// to have dark-themed circuits, set this to white for instance and
53-
/// update `wire` and `fill` accordingly.
54-
/// -> color
55-
color: black,
56-
5751
/// Default fill color for gates.
5852
/// -> color
5953
fill: white,
@@ -100,7 +94,7 @@
10094
if children.named().len() > 0 {
10195
panic("Unexpected named argument '" + children.named().keys().at(0) + "' for quantum-circuit()")
10296
}
103-
if type(wire) == color { wire += .7pt }
97+
if type(wire) == std.color { wire = .7pt }
10498
if type(wire) == length { wire += black }
10599

106100
set text(wire.paint, size: font-size)
@@ -113,7 +107,6 @@
113107
wire: wire,
114108
padding: measure(line(length: gate-padding)).width,
115109
background: fill,
116-
color: color,
117110
x-gate-size: none,
118111
multi: (wire-distance: 0pt)
119112
)

tests/gates/meter/test.typ

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
#quantum-circuit(
1919
gate-padding: 2pt,
2020
wire: .2pt + red,
21-
color: red,
2221
1, meter(label: $y$), 1, meter(n: 1, label: $lr(|plus.minus〉)$), meter(label: $phi/2$, n: 1, wire-count: 1), meter(target: 1, label: "a"), meter(n: 2, label: "a"), [\ ],
2322
1, gate($H$), 3, ctrl(), 2
2423
)

0 commit comments

Comments
 (0)