You need to get the numbers from rgba (число, число, число, число) using RegExp . Numbers should not be displayed as separate numbers, but as a full number.

That is, not [2], [2], [5], [], [3], [1] but [225], [], [31]

  • rgba \((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3}),\s*(\d*(?:\.\d+)?)\) - entithat

1 answer 1

It is necessary to use .match(/\d+/g) . \d will find the numbers, and + will find and stick together the numbers going in a row.