yjs / y-prosemirror

ProseMirror editor binding for Yjs
https://demos.yjs.dev/prosemirror/prosemirror.html
MIT License
328 stars 115 forks source link

fix: remove random number in cursor selection builder #148

Open baotpham opened 9 months ago

baotpham commented 9 months ago

this causes selection color not rendering properly

icode commented 9 months ago

I don't understand why we need to add 70

troglodytto commented 2 months ago

This is to make sure that the Alpha Channel of the Color is set to 70% opacity. Hence, when selecting the text, it overlays and does not hide the content below it. However, it only supports Hex Color as you can see in the code, and PR https://github.com/yjs/y-prosemirror/pull/154 fixes this for HSLA/RGB color codes

So @baotpham @icode it may seem like a "random" number, but it is not