I am able to loop through my JSON object values and find the string I am looking for, but i am not sure how to set the new values after it has been modified. I may be taking the wrong approach but could use some feedback on how it make it work and what the appropriate method should be.
this.specVars = {
rgba_000000 : "rgba(0, 0, 0, 1)", //Black
rgba_222222 : "rgba(34, 34, 34, 1)", //Dark gray
rgba_2ba6cb : "rgba(43, 166, 203, 1)",
rgba_336699 : "rgba(51, 102, 153, 1)", //Blue hyperlink
rgba_ffffff : "rgba(255, 255, 255, 1)", //White
};
// Test the browser being used and drop the alpha(opacity) value from the color values when using firefox
// Convert the values in the object to an array for parsing each value
var colors = this.specVars;
var values = Object.values(colors);
for (var value of values){
if(value.includes(', 1)')){
value = value.replace(', 1)', ')');
value = value.replace('rgba', 'rgb');
//How do i set the value in the actual object??
console.log(value);
};
}