![]() Topic awaiting preservation: Using "RGB(###,###,###) with variables?? (Page 1 of 1) |
|
---|---|
Neurotic (0) Inmate Newly admitted From: |
![]() Hi, i'm quite new to javascript, and I have this poblem which is bummy and annoying. |
Paranoid (IV) Inmate From: France |
![]() [überQuickReply] code: parent.body.document.bgColor="rgb(redbox,greenbox,bluebox)"; by code: parent.body.document.bgColor="rgb("+redbox+","+greenbox+","+bluebox+")"; Hope that helps... |
Obsessive-Compulsive (I) Inmate From: |
![]() Yeah that worked great, thanks |
Obsessive-Compulsive (I) Inmate From: |
![]() Ok I have another problem |
Bipolar (III) Inmate From: Umeå, Sweden |
![]() Cicatriz: Yes, it is possible. You'll have to do some math, though. What contrasting colour do you want - the inverse? The opposite hue at the same brightness? |
Obsessive-Compulsive (I) Inmate From: |
![]() Yeah I want the opposite, so if the background was black the heading text would turn white. |
Bipolar (III) Inmate From: Umeå, Sweden |
![]() Then you just take 255-r, 255-g and 255-g. Simple as that. The same brightness/opposite hue thing is more difficult. |
Obsessive-Compulsive (I) Inmate From: |
![]() Ermmm, could you give me an example. I have |
Bipolar (III) Inmate From: Umeå, Sweden |
![]() parent.body.document.bgColor="rgb("+(255-redbox)+","+(255-greenbox)+","+(255-bluebox)+")"; |
Paranoid (IV) Inmate From: France |
![]() cicatriz: It'd be great if you tried some things by yourself before asking the solution. |
Obsessive-Compulsive (I) Inmate From: |
![]() I did try it on my own, infact I spent several hours looking about on google before I finally decided to use a forum for your information |
Paranoid (IV) Inmate From: Madison, Indiana, USA |
![]() cicatriz, code: parent.body.document.bgColor="rgb("+redbox+","+greenbox+","+bluebox+")";
|
Obsessive-Compulsive (I) Inmate From: |
![]() ok thanks guys, thats a big help. |