Skip to content

Commit 292d6ba

Browse files
Use new colored API (#173)
`fg`, `bg`, and `attr` were renamed to `fore`, `back`, and `style` in `colored` 1.5.0 and onwards. Although these functions were added back in `colored` 2.1.1 for backwards-compatibility, the docstring indicates that they will be deprecated in the future. Co-authored-by: Peter Corke <peter.i.corke@gmail.com>
1 parent 09b0c43 commit 292d6ba

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

spatialmath/baseposematrix.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
# colored printing of matrices to the terminal
2424
# colored package has much finer control than colorama, but the latter is available by default with anaconda
2525
try:
26-
from colored import fg, bg, attr
26+
from colored import fore, back, style
2727

2828
_colored = True
2929
# print('using colored output')
@@ -926,12 +926,12 @@ def color(c, f):
926926
else:
927927
return f(c)
928928

929-
bgcol = color(self._bgcolor, bg)
930-
trcol = color(self._transcolor, fg) + bgcol
931-
rotcol = color(self._rotcolor, fg) + bgcol
932-
constcol = color(self._constcolor, fg) + bgcol
933-
indexcol = color(self._indexcolor[0], fg) + color(self._indexcolor[1], bg)
934-
reset = attr(0)
929+
bgcol = color(self._bgcolor, back)
930+
trcol = color(self._transcolor, fore) + bgcol
931+
rotcol = color(self._rotcolor, fore) + bgcol
932+
constcol = color(self._constcolor, fore) + bgcol
933+
indexcol = color(self._indexcolor[0], fore) + color(self._indexcolor[1], back)
934+
reset = style(0)
935935
else:
936936
bgcol = ""
937937
trcol = ""

0 commit comments

Comments
 (0)