Skip to content

Commit 5c7b8ad

Browse files
authored
Merge branch 'master' into blank_patterns
2 parents 6f60171 + c88706e commit 5c7b8ad

File tree

14 files changed

+1505
-322
lines changed

14 files changed

+1505
-322
lines changed

mathics/builtin/colors/color_directives.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,12 @@ def to_js(self):
204204
return self.to_rgba()
205205

206206
def to_expr(self):
207-
return to_expression(self.get_name(), *self.components)
207+
"""Convert components to MachineReal consistently so that colors with
208+
numerically-equal components but different numeric atom types compare equal.
209+
"""
210+
return to_expression(
211+
self.get_name(), *self.components, elements_conversion_fn=MachineReal
212+
)
208213

209214
def to_rgba(self):
210215
return self.to_color_space("RGB")

0 commit comments

Comments
 (0)