"symbols()"
is no longer available in QGIS 3.0 and replaced by "QgsRenderContext& context"
method, but I do not find the correct way to write this instruction.
from PyQt5.QtGui import *
lyr=iface.activeLayer()
symbols = lyr.renderer().symbols()
sym = symbols[0]
sym.setColor(QColor.fromRgb(255,0,0))
lyr.triggerRepaint()