Create color mark for text node

Many thanks, now I got no error anymore. However, I am trying to insert some text as follows

const tr = view.state.tr.replaceRangeWith(
                    range.from, range.to+1,
                    view.state.schema.text("testHere"), 
                    [view.state.schema.mark("color")]) 

It throws no errors with the “color” mark (but other unregistered terms like “color2” do, so apparently it “sees” the color mark). Yet it just inserts the desired text, but with no formatting, that the color is blue in this case. Do you know, if something is wrong with the mark declaration or somewhere else?