yjs / y-prosemirror

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

fix: remove random number in cursor selection builder #148

Open baotpham opened 1 year ago

baotpham commented 1 year ago

this causes selection color not rendering properly

icode commented 1 year ago

I don't understand why we need to add 70

troglodytto commented 6 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