From 4c7b457d52e5b5916e95647a7b4c09ecd620891e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EC=97=B0=EC=A7=84?= Date: Mon, 27 Oct 2025 23:27:08 +0900 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20=EC=83=89=EC=83=81=20=ED=98=95?= =?UTF-8?q?=EC=8B=9D=20=EB=AF=B8=EC=A7=80=EC=9B=90=20=EB=AC=B8=EC=A0=9C=20?= =?UTF-8?q?=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/constants/regex.ts | 3 ++- src/core/utils/colorScale.ts | 8 +++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/core/constants/regex.ts b/src/core/constants/regex.ts index ac01e9d..6b78c04 100644 --- a/src/core/constants/regex.ts +++ b/src/core/constants/regex.ts @@ -1,3 +1,4 @@ -export const variableRegex = /(--color-[\w-]+):\s*(#[0-9a-fA-F]{3,8})/g; +export const variableRegex = + /(--color-[\w-]+):\s*([#a-fA-F0-9]{3,8}|(?:oklch|lab|rgb|hsl)\([^)]+\))/g; export const variationRegex = /^--(.+?)-(50|100|200|300|400|500|600|700|800|900)$/i; diff --git a/src/core/utils/colorScale.ts b/src/core/utils/colorScale.ts index fa8f758..c30873a 100644 --- a/src/core/utils/colorScale.ts +++ b/src/core/utils/colorScale.ts @@ -6,10 +6,12 @@ const CLAMP01 = (x: number) => Math.max(0, Math.min(1, x)); type ColorCtor = typeof ColorModule; -const Color = ((ColorModule as unknown as { default?: ColorCtor }).default ?? ColorModule) as ColorCtor; +const Color = ((ColorModule as unknown as { default?: ColorCtor }).default ?? + ColorModule) as ColorCtor; -function hexToOKLCH(hex: string) { - const c = new Color(hex); +function hexToOKLCH(color: string) { + const normalizedColor = color.replace(/,(?=\s*\d)/g, ' '); + const c = new Color(normalizedColor); const o = c.to('oklch'); return { l: o.l, c: o.c, h: o.h ?? 0 }; } From ec5bf74cf13d614f2ea44b1c59a19a90ae23d89e Mon Sep 17 00:00:00 2001 From: Yeonjin Kim Date: Mon, 27 Oct 2025 23:28:00 +0900 Subject: [PATCH 2/2] =?UTF-8?q?'fix:=20=EB=A6=AC=EB=93=9C=EB=AF=B8=20alt?= =?UTF-8?q?=20=EC=88=98=EC=A0=95'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Updated project description, features, installation, usage instructions, and team information in README. --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 68a30fe..437b719 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ #### A React theme switching library that makes it easy to apply color-blind accessible UI themes. -스크린샷 2025-10-27 오전 9 05 44 +colbrush --- @@ -236,3 +236,4 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +