Colbrush ๋ผ์ด๋ธ๋ฌ๋ฆฌ์ ๊ธฐ๋ฅ ํ ์คํธ ๋ฐ ๋ฐ๋ชจ๋ฅผ ์ํ ๊ณต์ ๋ฌธ์ ์ฌ์ดํธ์ ๋๋ค. ์๊ฐ ์ด์์๋ฅผ ์ํ ์ ๊ทผ์ฑ ์ค์ฌ์ ๋์์ธ ์์คํ ๋ผ์ด๋ธ๋ฌ๋ฆฌ์ธ Colbrush์ ๋ค์ํ ๊ธฐ๋ฅ์ ๊ฒ์ฆํ๊ณ ์์ฐํฉ๋๋ค.
์ด ์ฌ์ดํธ๋ ๋ค์๊ณผ ๊ฐ์ ๋ชฉ์ ์ผ๋ก ํ์ฉ๋ฉ๋๋ค:
- ๋ผ์ด๋ธ๋ฌ๋ฆฌ ๊ธฐ๋ฅ ํ ์คํธ: Colbrush์ ํต์ฌ ๊ธฐ๋ฅ๋ค์ ์ค์ ํ๊ฒฝ์์ ํ ์คํธ
- ๋ฌธ์ํ: Colbrush ์ค์น, ์ค์ , ํตํฉ ๋ฐฉ๋ฒ ์๋ด
- ์ธํฐ๋ํฐ๋ธ ๋ฐ๋ชจ: ์๊ฐ ์ด์ ์ ํ๋ณ ์์ ๋ณ์ ์ ์ ๋ฐฉ์ ์์ฐ
- ์ ๊ทผ์ฑ UI ํจํด ์ผ์ผ์ด์ค: Colbrush๋ก ๊ตฌํ ๊ฐ๋ฅํ ์ ๊ทผ์ฑ UI ์ปดํฌ๋ํธ ์์
ํ์ฌ ํ ์คํธ ์ค์ธ Colbrush์ ์ฃผ์ ๊ธฐ๋ฅ๋ค:
- ThemeProvider (
colbrush/client): ์๊ฐ ์ด์ ์ ํ๋ณ ํ ๋ง ์ ๊ณต - ThemeSwitcher (
colbrush/client): ์ฌ์ฉ์๊ฐ ์ง์ ํ ๋ง๋ฅผ ์ ํํ ์ ์๋ UI - SimulationFilter (
colbrush/devtools): ์๊ฐ ์ด์ ์๋ฎฌ๋ ์ด์ ํํฐ (๊ฐ๋ฐ ๋ฐ ํ๋ก๋์ ํ๊ฒฝ ์ง์)
- Install (
/): Colbrush ์ค์น ๋ฐ ์ด๊ธฐ ์ค์ ๊ฐ์ด๋ - API (
/api): Colbrush API ๋ฌธ์ ๋ฐ ์ฌ์ฉ๋ฒ - Usage (
/usage): ์ค์ UI ์ปดํฌ๋ํธ ์์ (๊ทธ๋ํ, ์ฐจํธ, ํฌ๋๋ฆฌ์คํธ ๋ฑ)
- Framework: React 19 + Vite
- Routing: React Router DOM v7
- Styling: Tailwind CSS v4 + Colbrush ํ ๋ง ์์คํ
- Charts: amCharts 5 (์ ๊ทผ์ฑ ๋ฐ์ดํฐ ์๊ฐํ)
- Build Tool: Vite + SWC
- Package Manager: npm/yarn/pnpm
git clone https://github.com/2025-OSDC/colbrush-test.git
cd colbrush-test
npm installnpm install colbrushnpm run devsrc/
โโโ App.tsx # ๋ฉ์ธ ์ฑ ์ปดํฌ๋ํธ (ThemeProvider ํตํฉ)
โโโ layouts/
โ โโโ Layout.tsx # ๋ ์ด์์ (SimulationFilter, ThemeSwitcher ํตํฉ)
โโโ pages/
โ โโโ install/ # ์ค์น ๊ฐ์ด๋ ํ์ด์ง
โ โโโ api/ # API ๋ฌธ์ ํ์ด์ง
โ โโโ usage/ # ์ฌ์ฉ ์์ ํ์ด์ง
โ โโโ component/ # ๋ฐ๋ชจ ์ปดํฌ๋ํธ๋ค
โ โโโ graph/ # ์ฐจํธ ์ปดํฌ๋ํธ
โ โโโ simulator/ # ์๊ฐ ์ด์ ์๋ฎฌ๋ ์ดํฐ
โ โโโ todo/ # ํฌ๋ ๋ฆฌ์คํธ ์์
โ โโโ ...
โโโ components/ # ๊ณตํต ์ปดํฌ๋ํธ
colbrush ์ฝ๋ ์ฃผ์ ์ฒ๋ฆฌ - ๊ธฐ๋ฅ ํ ์คํธ๋ฅผ ์ํด ๋ค์ ์ปดํฌ๋ํธ๋ค์ ์์๋ก ๋นํ์ฑํ:
-
ThemeProviderimport ๋ฐ ๋ํ ์ฃผ์ ์ฒ๋ฆฌ
-
SimulationFilter์ปดํฌ๋ํธ ์ฃผ์ ์ฒ๋ฆฌThemeSwitcher์ปดํฌ๋ํธ ์ฃผ์ ์ฒ๋ฆฌ
-
- Colbrush ์คํ์ผ์ํธ import ์ฃผ์ ์ฒ๋ฆฌ
- ์๊ฐ ์ด์ ์ ํ๋ณ ํ ๋ง CSS ๋ณ์ ์ฃผ์ ์ฒ๋ฆฌ (deuteranopia, protanopia, tritanopia, monochromacy)
-
src/pages/usage/component/graph/MapChart.tsx, src/pages/usage/component/graph/DonutChart.tsx, src/pages/usage/component/graph/LineChart.tsx
useThemehook import ์ฃผ์ ์ฒ๋ฆฌtheme๋ณ์ ์ฃผ์ ์ฒ๋ฆฌuseEffectdependency array์์theme์์กด์ฑ ๋นํ์ฑํ
-
๋ฆฌํฌ์งํ ๋ฆฌ ํด๋ก ๋ฐ ์ค์น
git clone https://github.com/2025-OSDC/colbrush-test.git cd colbrush-test npm install npm install colbrush -
๊ธฐ๋ณธ UI ํ ์คํธ: ์ฃผ์ ์ฒ๋ฆฌ ์ํ์์ ๊ธฐ๋ณธ ์คํ์ผ๋ง ํ์ธ
npm run dev
-
Colbrush ํ์ฑํ: ์ฃผ์ ํด์ ํ ์๊ฐ ์ด์ ๋์ ํ ๋ง ๋์ ํ์ธ
-
๋น๊ต ๋ถ์: ํ์ฑํ ์ ํ ์ ๊ทผ์ฑ ๊ฐ์ ํจ๊ณผ ๊ฒ์ฆ
ํ ์คํธ๋ฅผ ์๋ฃํ๊ณ Colbrush ๊ธฐ๋ฅ์ ํ์ฑํํ๋ ค๋ฉด ๋ค์ ํ์ผ๋ค์ ์ฃผ์์ ํด์ ํ์ธ์:
/* ์ฃผ์ ํด์ */
@import 'colbrush/styles.css';
/* npx colbrush --generate๋ก ์๋งน ์ ํ๋ณ ํ
๋ง ๋ณ์ ์์ฑ */
[data-theme='deuteranopia'] { /* ... */ }
[data-theme='protanopia'] { /* ... */ }
[data-theme='tritanopia'] { /* ... */ }// ์ฃผ์ ํด์
import { ThemeProvider } from "colbrush/client";
function App() {
return (
<ThemeProvider>
{/* ... */}
</ThemeProvider>
);
}// ์ฃผ์ ํด์
import { SimulationFilter } from "colbrush/devtools";
import { ThemeSwitcher } from "colbrush/client";
// JSX์์ ์ฃผ์ ํด์
<SimulationFilter allowInProd={true} />
<ThemeSwitcher />src/pages/usage/component/graph/MapChart.tsx
// ์ฃผ์ ํด์
import { useTheme } from "colbrush/client";
const MapChart = () => {
// ์ฃผ์ ํด์
const theme = useTheme().theme;
useEffect(() => {
// ...
// 79-80๋ฒ ์ค: ์๋ ์ค์ ์ฃผ์ ์ฒ๋ฆฌํ๊ณ
}, []); // Colbrush ํ
์คํธ์ฉ: theme ์์กด์ฑ ๋นํ์ฑํ
// ์ด ์ค์ ์ฃผ์์ ํด์
// }, [theme]); // Colbrush ํ์ฑํ: ์ด ์ค์ ์ฃผ์์ ํด์ ํ๊ณ ์ ์ค์ ์ฃผ์ ์ฒ๋ฆฌ
};src/pages/usage/component/graph/DonutChart.tsx
// ์ฃผ์ ํด์
import { useTheme } from "colbrush/client";
const DonutChart = () => {
// ์ฃผ์ ํด์
const theme = useTheme().theme;
useEffect(() => {
// ...
// 113-114๋ฒ ์ค: ์๋ ์ค์ ์ฃผ์ ์ฒ๋ฆฌํ๊ณ
}, []); // Colbrush ํ
์คํธ์ฉ: theme ์์กด์ฑ ๋นํ์ฑํ
// ์ด ์ค์ ์ฃผ์์ ํด์
// }, [theme]); // Colbrush ํ์ฑํ: ์ด ์ค์ ์ฃผ์์ ํด์ ํ๊ณ ์ ์ค์ ์ฃผ์ ์ฒ๋ฆฌ
};src/pages/usage/component/graph/LineChart.tsx
// ์ฃผ์ ํด์
import { useTheme } from "colbrush/client";
function LineChart() {
// ์ฃผ์ ํด์
const theme = useTheme().theme;
useEffect(() => {
// ...
// 118-119๋ฒ ์ค: ์๋ ์ค์ ์ฃผ์ ์ฒ๋ฆฌํ๊ณ
}, []); // Colbrush ํ
์คํธ์ฉ: theme ์์กด์ฑ ๋นํ์ฑํ
// ์ด ์ค์ ์ฃผ์์ ํด์
// }, [theme]); // Colbrush ํ์ฑํ: ์ด ์ค์ ์ฃผ์์ ํด์ ํ๊ณ ์ ์ค์ ์ฃผ์ ์ฒ๋ฆฌ
}colbrush(^1.11.0) - ํต์ฌ ๋ผ์ด๋ธ๋ฌ๋ฆฌreact(^19.1.1)react-router-dom(^7.8.0)tailwindcss(^4.1.12)@amcharts/amcharts5(^5.13.5) - ์ ๊ทผ์ฑ ์ฐจํธ ๋ผ์ด๋ธ๋ฌ๋ฆฌ
์์ธํ ์์กด์ฑ ์ ๋ณด: package.json
- NPM Package: colbrush
- GitHub Organization: 2025-OSDC
- Core Library: colbrush/colbrush