There is a "Data Graphics" feature in Visio, but it just can work on text color and fill color.
If you want to change the online color, you may set a formula in "ShapeSheet" ( Such as a IF formula for LineColor under Line Format section) for specific shapes.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.