diff --git a/src/engraving/rw/read410/tread.cpp b/src/engraving/rw/read410/tread.cpp index f1b6d6cceada5..6392edbac120e 100644 --- a/src/engraving/rw/read410/tread.cpp +++ b/src/engraving/rw/read410/tread.cpp @@ -4272,13 +4272,18 @@ bool TRead::readProperties(Staff* s, XmlReader& e, ReadContext& ctx) } else if (tag == "keylist") { TRead::read(s->keyList(), e, ctx); } else if (tag == "bracket") { + Color color = Color::fromString(e.attribute("color")); int col = e.intAttribute("col", -1); if (col == -1) { col = static_cast(s->brackets().size()); } s->setBracketType(col, BracketType(e.intAttribute("type", -1))); s->setBracketSpan(col, e.intAttribute("span", 0)); - s->setBracketVisible(col, static_cast(e.intAttribute("visible", 1))); + BracketItem* bi = s->brackets().at(col); + bi->setVisible(static_cast(e.intAttribute("visible", 1))); + if (color.isValid()) { + bi->setColor(color); + } e.readNext(); } else if (tag == "barLineSpan") { s->setBarLineSpan(e.readInt()); diff --git a/src/engraving/rw/write/twrite.cpp b/src/engraving/rw/write/twrite.cpp index 85d63d850234f..72b09dbd8b396 100644 --- a/src/engraving/rw/write/twrite.cpp +++ b/src/engraving/rw/write/twrite.cpp @@ -2708,12 +2708,20 @@ void TWrite::write(const Staff* item, XmlWriter& xml, WriteContext& ctx) } for (const BracketItem* i : item->brackets()) { + XmlWriter::Attributes attrs; BracketType a = i->bracketType(); + attrs.push_back({ "type", static_cast(a) }); size_t b = i->bracketSpan(); + attrs.push_back({ "span", b }); size_t c = i->column(); + attrs.push_back({ "col", c }); bool v = i->visible(); + attrs.push_back({ "visible", v }); + if (i->color() != ctx.configuration()->defaultColor()) { + attrs.push_back({ "color", String::fromStdString(i->color().toString()) }); + } if (a != BracketType::NO_BRACKET || b > 0) { - xml.tag("bracket", { { "type", static_cast(a) }, { "span", b }, { "col", c }, { "visible", v } }); + xml.tag("bracket", attrs); } }