Astrocoders / react-native-selectable-text

Capture text selection and customize the action menu
MIT License
225 stars 96 forks source link

Different highlight colors #46

Open davidteejay opened 4 years ago

davidteejay commented 4 years ago

Hi, Nice work so far. This module has really saved me 😄

Is it possible to have a feature where you can specify the color per highlight? This will be very useful if someone wants to have different colors for the highlighted texts.

Thank you.

guilhermedecampo commented 4 years ago

Hey David! Thanks for the kind words.

It's pretty much possible. You need to do some logic in your side for that. So you would control how the highlighted excerpt should behave.

guilhermedecampo commented 4 years ago

If you wanna do it and add it as example on our repo, you're most welcome.

desaawa commented 4 years ago

@guilhermedecampo I think the challenge here would be with changing the color of the highlighted text, as some highlight colors might need you the change the text color.

For instance, I'm using yellow, but when i switch to dark mode, I'd like the maintain the yellow highlight but all my text is now white-ish, and I'd like to make the color of the text behind the yellow highlight not-white so that it can work with the yellow background...

Would it be possible to have a prop for the color of the highlighted text?