0

I applied ::selection background-color but when I am checking using selection color using digital color meter it shows me different color

here is my code https://jsbin.com/voketaqaxu/edit?html,css,js,output

::selection{
  background-color: rgb(78,106,65);

} 

I applied background-color: rgb(78,106,65); on selection , but when I checked using digital color it show me this rgb(42,70,31) why ??

enter image description here

johannchopin
  • 13,720
  • 10
  • 55
  • 101
user5711656
  • 3,310
  • 4
  • 33
  • 70
  • Does this answer your question? [CSS selection color behaving strangely on Chrome](https://stackoverflow.com/questions/14970891/css-selection-color-behaving-strangely-on-chrome) – Birdmii Oct 31 '20 at 14:19

1 Answers1

0

Possibly to prevent exactly what you are trying to do.

Looks like Chrome will change the background color opacity of the selection if it's 1. You can cheat this by setting the opacity very close to 1 e.g.

background-color: rgb(78,106,65, .99);
wangdev87
  • 8,611
  • 3
  • 8
  • 31