Skip to content

Commit

Permalink
reduce-color-value-space
Browse files Browse the repository at this point in the history
移除颜色值里面的空格
  • Loading branch information
ioahc committed Nov 14, 2024
1 parent 9aa417b commit f685962
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ function App() {

switch (targetMode) {
case 'rgb':
return `rgb(${r}, ${g}, ${b})`;
return `rgb(${r},${g},${b})`;
case 'hex':
return `#${[r, g, b].map(x => x.toString(16).padStart(2, '0')).join('')}`;
case 'hsl':
Expand All @@ -161,7 +161,7 @@ function App() {
}
h *= 60;
}
return `hsl(${Math.round(h)}, ${Math.round(s * 100)}%, ${Math.round(l * 100)}%)`;
return `hsl(${Math.round(h)},${Math.round(s * 100)}%,${Math.round(l * 100)}%)`;
default:
return color;
}
Expand Down

0 comments on commit f685962

Please sign in to comment.