{
- try {
- const isPaused = game.download?.status === "paused";
- const colorToUse = isPaused
- ? "#ffffff"
- : dominantColors[game.id] || "#ffffff";
- const hex = colorToUse;
- if (hex.startsWith("#")) {
- const r = parseInt(hex.slice(1, 3), 16);
- const g = parseInt(hex.slice(3, 5), 16);
- const b = parseInt(hex.slice(5, 7), 16);
- return `linear-gradient(90deg, rgba(${r}, ${g}, ${b}, 0.95) 0%, rgba(${r}, ${g}, ${b}, 0.65) 100%)`;
- }
- if (hex.startsWith("rgb")) {
- const nums = hex.match(/\d+/g) || [];
- const r = nums[0] || 8;
- const g = nums[1] || 234;
- const b = nums[2] || 121;
- return `linear-gradient(90deg, rgba(${r}, ${g}, ${b}, 0.95) 0%, rgba(${r}, ${g}, ${b}, 0.65) 100%)`;
- }
- return undefined;
- } catch (e) {
- return undefined;
- }
- })(),
+ width: `${progress * 100}%`,
+ backgroundColor: "#fff",
}}
/>