.box {
color: red;
background: yellow;
box-shadow: 1px 3px rgba(34,53,45,0.5);
}
0: "tomato"
1: "yellow"
2: "rgba(34, 53, 45, 0.5) 1px 3px"
3: "red"
const unColorValues = ["inherit", "transparent", "initial"];
var notUniqueArray = [...document.styleSheets[0].cssRules]
.map(c => c.style)
.map(c => Object.entries(c)
.filter(ent => (ent[0].toLowerCase().includes('color') || ent[0].toLowerCase().includes('boxshadow')) && !!ent[1]))
.flat()
.map(prop => prop[1])
.flat()
var uniqueArray = [...new Set(notUniqueArray)]
var colors = uniqueArray.filter(val => !unColorValues.includes(val))
console.log('uniqueArray: ', colors);
тут только это.
body {
background: tomato;
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>HTML5</title>
<link href="style.css" rel="stylesheet" type="text/css"/>
<script src="script.js" type="text/javascript"></script>
</head>
<body>
<p>Привет, мир</p>
</body>
</html>