Skip to content

Commit bad0246

Browse files
authored
Merge pull request #72 from 2025-OSDC/develop
[Deploy] 배포
2 parents df26f0c + ec22397 commit bad0246

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
#### A React theme switching library that makes it easy to apply color-blind accessible UI themes.
44

5-
<img width="1434" height="314" alt="스크린샷 2025-10-27 오전 9 05 44" src="https://github.com/user-attachments/assets/c009bd8c-974c-4e99-b28b-86acb9df26d9" />
5+
<img width="1434" height="314" alt="colbrush" src="https://github.com/user-attachments/assets/c009bd8c-974c-4e99-b28b-86acb9df26d9" />
66

77
---
88

@@ -236,3 +236,4 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
236236
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
237237
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
238238
SOFTWARE.
239+

src/core/constants/regex.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1-
export const variableRegex = /(--color-[\w-]+):\s*(#[0-9a-fA-F]{3,8})/g;
1+
export const variableRegex =
2+
/(--color-[\w-]+):\s*([#a-fA-F0-9]{3,8}|(?:oklch|lab|rgb|hsl)\([^)]+\))/g;
23
export const variationRegex =
34
/^--(.+?)-(50|100|200|300|400|500|600|700|800|900)$/i;

src/core/utils/colorScale.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,12 @@ const CLAMP01 = (x: number) => Math.max(0, Math.min(1, x));
66

77
type ColorCtor = typeof ColorModule;
88

9-
const Color = ((ColorModule as unknown as { default?: ColorCtor }).default ?? ColorModule) as ColorCtor;
9+
const Color = ((ColorModule as unknown as { default?: ColorCtor }).default ??
10+
ColorModule) as ColorCtor;
1011

11-
function hexToOKLCH(hex: string) {
12-
const c = new Color(hex);
12+
function hexToOKLCH(color: string) {
13+
const normalizedColor = color.replace(/,(?=\s*\d)/g, ' ');
14+
const c = new Color(normalizedColor);
1315
const o = c.to('oklch');
1416
return { l: o.l, c: o.c, h: o.h ?? 0 };
1517
}

0 commit comments

Comments
 (0)