{"id":19689983,"url":"https://github.com/element-plus/colors","last_synced_at":"2026-03-06T04:03:44.365Z","repository":{"id":48389282,"uuid":"386469535","full_name":"element-plus/colors","owner":"element-plus","description":"🎨 This repository is meant for build color utils for theme customization ","archived":false,"fork":false,"pushed_at":"2021-07-28T15:52:52.000Z","size":109,"stargazers_count":21,"open_issues_count":0,"forks_count":3,"subscribers_count":12,"default_branch":"main","last_synced_at":"2025-08-26T06:28:49.970Z","etag":null,"topics":["element-ui"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/element-plus.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-07-16T01:16:27.000Z","updated_at":"2025-03-04T09:12:59.000Z","dependencies_parsed_at":"2022-08-20T18:50:48.484Z","dependency_job_id":null,"html_url":"https://github.com/element-plus/colors","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/element-plus/colors","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/element-plus%2Fcolors","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/element-plus%2Fcolors/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/element-plus%2Fcolors/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/element-plus%2Fcolors/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/element-plus","download_url":"https://codeload.github.com/element-plus/colors/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/element-plus%2Fcolors/sbom","scorecard":{"id":372143,"data":{"date":"2025-08-11","repo":{"name":"github.com/element-plus/colors","commit":"72a70a39c4038dda4e2de9aa1b0abb0b540deb59"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.7,"checks":[{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":2,"reason":"Found 3/11 approved changesets -- score normalized to 2","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/publish-npm.yml:1","Warn: no topLevel permission defined: .github/workflows/unit-test.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish-npm.yml:11: update your workflow using https://app.stepsecurity.io/secureworkflow/element-plus/colors/publish-npm.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish-npm.yml:13: update your workflow using https://app.stepsecurity.io/secureworkflow/element-plus/colors/publish-npm.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish-npm.yml:27: update your workflow using https://app.stepsecurity.io/secureworkflow/element-plus/colors/publish-npm.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish-npm.yml:28: update your workflow using https://app.stepsecurity.io/secureworkflow/element-plus/colors/publish-npm.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/unit-test.yml:10: update your workflow using https://app.stepsecurity.io/secureworkflow/element-plus/colors/unit-test.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/unit-test.yml:12: update your workflow using https://app.stepsecurity.io/secureworkflow/element-plus/colors/unit-test.yml/main?enable=pin","Info:   0 out of   6 GitHub-owned GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 13 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"19 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-gcx4-mw62-g8wm","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-4wf5-vphf-c2xc","Warn: Project is vulnerable to: GHSA-jgrx-mgxx-jf9v","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3","Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7","Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-18T13:13:22.722Z","repository_id":48389282,"created_at":"2025-08-18T13:13:22.722Z","updated_at":"2025-08-18T13:13:22.722Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30161345,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-05T22:39:40.138Z","status":"online","status_checked_at":"2026-03-06T02:00:08.268Z","response_time":250,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["element-ui"],"created_at":"2024-11-11T19:03:56.702Z","updated_at":"2026-03-06T04:03:44.350Z","avatar_url":"https://github.com/element-plus.png","language":"TypeScript","readme":"# Element Plus Colors\n\n[English](README.md) | [中文](README.zh-CN.md)\n\nThis project for build color utils for theme customization\n\n\nThe mixing algorithm referenced from [dart-sass's mixColor](https://github.com/sass/dart-sass/blob/main/lib/src/functions/color.dart#_mixColors) algorithm\n\nFormula for calculating the primary color:\n```js\nmix('#FFF', primary, i * 10) // i from 0 to 9\n```\n\nFormula for calculating the secondary color:\n```js\nmix('#FFF', color, '0')      // secondary color\nmix('#FFF', color, '80%')    // secondary light color\nmix('#FFF', color, '90%')    // secondary lighter color\n```\n\n## Install\n\n### yarn\n```bash\nyarn add @element-plus/colors\n```\n### npm\n```bash\nnpm install @element-plus/colors\n```\n## Usage\n\n### Basic\n```js\nimport { generateColors } from '@element-plus/colors'\n\nconst { primary, success, warning, danger, error, info } = generateColors('#409eff')\n// or\n// const { primary, success, warning, danger, error, info } = generateColors({ primary: '#409eff' })\nconsole.log(primary)\n// [\n//  'rgba(64, 158, 255, 1)',\n//  'rgba(83, 168, 255, 1)',\n//  'rgba(102, 177, 255, 1)',\n//  'rgba(121, 187, 255, 1)',\n//  'rgba(140, 197, 255, 1)',\n//  'rgba(160, 207, 255, 1)',\n//  'rgba(179, 216, 255, 1)',\n//  'rgba(198, 226, 255, 1)',\n//  'rgba(217, 236, 255, 1)',\n//  'rgba(236, 245, 255, 1)'\n// ]\nconsole.log(success)\n// [\n//  'rgba(103, 194, 58, 1)',\n//  'rgba(225, 243, 216, 1)',\n//  'rgba(240, 249, 235, 1)'\n// ]\nconsole.log(warning)\n// [\n//  'rgba(230, 162, 60, 1)',\n//  'rgba(250, 236, 216, 1)',\n//  'rgba(253, 246, 236, 1)'\n// ]\nconsole.log(danger)\n// [\n//  'rgba(245, 108, 108, 1)',\n//  'rgba(253, 226, 226, 1)',\n//  'rgba(254, 240, 240, 1)'\n// ]\nconsole.log(error)\n// [\n//  'rgba(245, 108, 108, 1)',\n//  'rgba(253, 226, 226, 1)',\n//  'rgba(254, 240, 240, 1)'\n// ]\nconsole.log(info)\n// [\n//  'rgba(144, 147, 153, 1)',\n//  'rgba(233, 233, 235, 1)',\n//  'rgba(244, 244, 245, 1)'\n// ]\n```\n\n### Preset colors\n\nWe provide preset colors, you can import them by `presetPalettes` or `paletteName`, all `paletteName` are listed below\n\n```js\nimport { presetPalettes } from '@element-plus/colors'\n// or\nimport { chalk } from '@element-plus/colors'\n\nconsole.log(presetPalettes)\n// {\n//     chalk: {\n//         primary: [...]\n//         success: [...]\n//         warning: [...]\n//         danger:  [...]\n//         error:   [...]\n//         info:    [...]\n//     }\n// }\nconsole.log(chalk)\n// {\n//     primary: [...]\n//     success: [...]\n//     warning: [...]\n//     danger:  [...]\n//     error:   [...]\n//     info:    [...]\n// }\n```\n\n#### chalk\n\nchalk is the default theme of element-plus\n\n```json\n{\n  \"primary\":  \"#409EFF\",\n  \"success\":  \"#67C23A\",\n  \"warning\":  \"#E6A23C\",\n  \"danger\":   \"#F56C6C\",\n  \"error\":    \"#F56C6C\",\n  \"info\":     \"#909399\"\n}\n```\n\n## API\n\n### generateColors(options: string | object)\n\n#### options\noptions can be a string or an object, if options is a string then it means it is a primary color.\n\nif options is an object, the following configuration:\n```typescript\n// Any invalid color will be overwritten by the default color\ninterface ColorOptions {\n    primary?: string\n    success?: string\n    warning?: string\n    // If only one of error and danger is provided,\n    // then that value will automatically be used to override the missing one\n    danger?:  string\n    error:    string[]\n    info?:    string\n}\n```\nIf you not provide any valid options, then the function will return the default colors\n\n#### return\n```typescript\ninterface OutputColors {\n    primary: string[]\n    success: string[]\n    warning: string[]\n    danger:  string[]\n    error:   string[]\n    info:    string[]\n}\n```\n\n## Development\n\n```bash\nyarn dev\n```\n\nfor coverage\n```bash\nyarn dev:coverage\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felement-plus%2Fcolors","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felement-plus%2Fcolors","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felement-plus%2Fcolors/lists"}