Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pick color dynamically #23

Open
cloudflypeng opened this issue Jan 10, 2024 · 4 comments
Open

pick color dynamically #23

cloudflypeng opened this issue Jan 10, 2024 · 4 comments
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@cloudflypeng
Copy link

cloudflypeng commented Jan 10, 2024

我看现在统一定义了一个textAccentMap用来获取颜色, 通过图标动态取主题色可以看看
这个库
我不太了解服务端渲染,你应该可以参考一下

textAccentMap is const variable to pick color, it would be better to pick color using some library

@himself65 himself65 added the enhancement New feature or request label Jan 11, 2024
@himself65 himself65 changed the title 关于动态获取主题色 pick color dynamically Jan 13, 2024
@himself65 himself65 added help wanted Extra attention is needed good first issue Good for newcomers labels Jan 13, 2024
@v1siuol
Copy link

v1siuol commented Jan 15, 2024

I like this idea, but looks like color-thief is a cjs lib, and I am not sure if there is an easy way to import it as an ES6 module in Node env note. We can probably find some other alternatives. (I am a beginner, so please correct me if I am wrong X

@cloudflypeng
Copy link
Author

I like this idea, but looks like color-thief is a cjs lib, and I am not sure if there is an easy way to import it as an ES6 module in Node env note. We can probably find some other alternatives. (I am a beginner, so please correct me if I am wrong X

the color-thief is not work , bacause it dependent get-pixels, i think the solution with dom or fileReader is not work. now i am learning how to get color from Uint8Array

@cloudflypeng
Copy link
Author

image

I got an incorrect color, but I feel like I'm getting closer. Another issue is that the color text - [# 482412] I generated was not generated by tailwind

@himself65
Copy link
Owner

You might need this one? https://tailwindcss.com/docs/text-color#arbitrary-values

And also consider the dark mode

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants