下面这段代码怎么改才能设置数组中元素的颜色啊啊
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<h1>占い</h1>
<span>名前:</span>
<input type="text" id="name">
<button id="uranau">占う</button>
<p id="result"></p>
<script>
'use strict';
const arr = ['大吉', '中吉', '小吉', '末吉', '凶']
const uranau = document.querySelector('#uranau')
const name = document.querySelector('#name')
const result = document.querySelector('#result')
uranau.addEventListener('click', function () {
const random = Math.floor(Math.random() * 5)
switch (random.value) {
case 0:
arr[0].style.color = 'pink'
break
case 1:
arr[1].style.color = 'blue'
break
case 2:
arr[2].style.color = 'orange'
break
case 3:
arr[3].style.color = 'green'
break
case 4:
arr[4].style.color = 'red'
break
}
result.innerHTML = name.value + 'さんの運勢:' + arr[random]
})
</script>
</body>
</html>