In Javascript how can I set rgba without specifying the rgb?

前端 未结 5 1144
旧巷少年郎
旧巷少年郎 2020-12-17 08:09

I have an HTML element whose background colour is set with rgba()

T

5条回答
  •  心在旅途
    2020-12-17 08:52

    You got the string, replace whatever
    'rgba(1,1,1,0.3)'.replace(/[^,]+(?=\))/, '0.5')

提交回复
热议问题