原文地址:https://victu360.com/archives/4474
實現方法一:
2 3 4 |
<action name="getRandomColor"> calc(%1, random * 0xFFFFFF); tohex(%1, %2, 6); </action> |
實現方法二:
2 3 4 5 6 7 8 9 10 11 |
getRandomColor(color, '#'); trace(get(color));
getRandomColor(color, '0x'); trace(get(color));
<action name="getRandomColor"> mul(%1, random, 16777215); roundval(%1); tohex(%1,%2,6); </action> |