Copy link to clipboard
Copied
Hello,
I have this Document JasvaScipt code:
function SetLayerStateFromRadioButton(){ event.target.exportValues.forEach(function(cVal,i){ oWidget = this.getField(event.targetName + "." + i); oWidget.lineWidth = (cVal == event.value)?1:0; oWidget.borderColor = (cVal == event.value)?color.green:["T"]; }); }
How can I change the green color to a dark green, this exact color: ["RGB", 40/255, 114/255, 79/255]
Here it is with the hex system #28724F
Thank you
Copy link to clipboard
Copied
You seem to already have an exact colour, you quote it. ["RGB", 40/255, 114/255, 79/255], which is a color array
So I don't understand what you mean by "change" or "convert". You can use whar you already have in place of color.green, since borderColor wants a color array, and color.green is just shorthand for the color array [ "RGB", 0,1,0 ]
Copy link to clipboard
Copied
You seem to already have an exact colour, you quote it. ["RGB", 40/255, 114/255, 79/255], which is a color array
So I don't understand what you mean by "change" or "convert". You can use whar you already have in place of color.green, since borderColor wants a color array, and color.green is just shorthand for the color array [ "RGB", 0,1,0 ]
Copy link to clipboard
Copied
Thank you, it's working, in fact I did not know where to add ["RGB", 40/255, 114/255, 79/255],
I put it after the color.green, but now I replace it with color.green
Here is the updated code, and it's working
function SetLayerStateFromRadioButton(){ event.target.exportValues.forEach(function(cVal,i){ oWidget = this.getField(event.targetName + "." + i); oWidget.lineWidth = (cVal == event.value)?1:0; oWidget.borderColor = (cVal == event.value)?["RGB", 40/255, 114/255, 79/255]:["T"]; }); }

