The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
Get the opposite of a color?
I'm not sure if this is even possible, but I figured if it was someone here would know how to do it.
Basically what I'm doing is trying to create a select box in which each option will have a different background color, and I would also like to have some text displayed in that select field for each color option. This creates a small problem since the text won't be readable with some of the colors. The colors are all pulled from an array to make things easier since I'm using them in several different places on the page, so is there any way to have the script find out what the opposite of that color would be? Hopefully that at least made a little sense. |
#2
|
||||
|
||||
well theoretically it's very easy.
just get the RGB values of the color and build the mirror color by subtracting the values of 255: example: newred = 255 - oldred .... that would result in complementary colors, but it wouldn't help you everyweher, because the complement of grey is grey |
#3
|
||||
|
||||
Thanks for the help Xenon. I didn't think there would be an easy way to make it work for every color. It's not a big deal though since it's just for a little e-card script I made (which I doubt will be used that much on my site), plus the text is at least readable when the mouse is over that color, so I guess that's good enough.
|
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|