Skip to content

Commit f31f2b9

Browse files
committed
Use new colored API
1 parent a29e647 commit f31f2b9

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

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')
@@ -916,12 +916,12 @@ def color(c, f):
916916
else:
917917
return f(c)
918918

919-
bgcol = color(self._bgcolor, bg)
920-
trcol = color(self._transcolor, fg) + bgcol
921-
rotcol = color(self._rotcolor, fg) + bgcol
922-
constcol = color(self._constcolor, fg) + bgcol
923-
indexcol = color(self._indexcolor[0], fg) + color(self._indexcolor[1], bg)
924-
reset = attr(0)
919+
bgcol = color(self._bgcolor, back)
920+
trcol = color(self._transcolor, fore) + bgcol
921+
rotcol = color(self._rotcolor, fore) + bgcol
922+
constcol = color(self._constcolor, fore) + bgcol
923+
indexcol = color(self._indexcolor[0], fore) + color(self._indexcolor[1], back)
924+
reset = style(0)
925925
else:
926926
bgcol = ""
927927
trcol = ""

0 commit comments

Comments
 (0)