Donnez vie à vos documents numériques !
 

Répondre à : Couleurs

abracadabraPDF Forums PDF – Général Couleurs Répondre à : Couleurs

#70142
Merlin
Maître des clés

Bonjour

 

  1. C’est parce-que les couleurs ne sont pas référencées correctement il manque /255, voir le script ci-dessous. Si la 1re fonctionnait c’est parce qu’elle n’utilisait que 255 et 0, si la dernière fonctionne c’est parce-que c’est une couleur nommée.

2. Il faut placer le script à la suite du calcul existant dans le bouton CALCUL, voir le ci-joint.

 

for (var j = 0; j < 53; j++) {

if (this.getField("diff."+j).value === 0) {
this.getField("diff."+j).fillColor = color.transparent;}

else if (this.getField("diff." +j).value === 1) {
this.getField("diff."+j ).fillColor = ["RGB", 0/255, 255/255, 0/255];}

else if (this.getField("diff." +j).value === 2) {
this.getField("diff."+j ).fillColor = ["RGB", 255/255, 205/255, 0/255];}

else if (this.getField("diff." +j).value === 3) {
this.getField("diff."+j ).fillColor = ["RGB", 255/255, 180/255, 0/255];}

else if (this.getField("diff." +j).value === 4) {
this.getField("diff."+j ).fillColor = ["RGB", 255/255, 149/255, 0/255];}

else if (this.getField("diff." +j).value === 5) {
this.getField("diff."+j ).fillColor = ["RGB", 255/255, 122/255, 0/255];}

else if (this.getField("diff." +j).value === 6) {
this.getField("diff."+j ).fillColor = ["RGB", 255/255, 102/255, 0/255];}

else if (this.getField("diff." +j).value === 7) {
this.getField("diff."+j ).fillColor = ["RGB", 255/255, 77/255, 0/255];}

else if (this.getField("diff." +j).value === 8) {
this.getField("diff."+j ).fillColor = ["RGB", 255/255, 54/255, 0/255];}

else if (this.getField("diff." +j).value === 9) {
this.getField("diff."+j ).fillColor = ["RGB", 255/255, 37/255, 0/255];}

else if (this.getField("diff." +j).value === 10) {
this.getField("diff."+j ).fillColor = color.red;}

else {this.getField("diff."+j ).fillColor = color.transparent;}

}

Attachments:
You must be logged in to view attached files.