Gathering detailed insights and metrics for @sinoui/material-color-utilities
Gathering detailed insights and metrics for @sinoui/material-color-utilities
Gathering detailed insights and metrics for @sinoui/material-color-utilities
Gathering detailed insights and metrics for @sinoui/material-color-utilities
Color libraries for Material You
npm install @sinoui/material-color-utilities
Typescript
Module System
TypeScript (22.95%)
Java (21.46%)
Swift (21.19%)
Dart (17.86%)
C++ (16.53%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
Apache-2.0 License
1,919 Stars
242 Commits
176 Forks
31 Watchers
1 Branches
11 Contributors
Updated on Jul 17, 2025
Latest Version
0.2.5
Package Id
@sinoui/material-color-utilities@0.2.5
Unpacked Size
608.46 kB
Size
99.24 kB
File Count
122
Published on
Feb 07, 2023
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
1
4
拷贝自 https://github.com/material-foundation/material-color-utilities 。主要用来解决无法在非 esm 环境中直接使用 @material/material-color-utilities 的问题。以后 @material/material-color-utilities 解决了 cjs 中直接使用的问题,再切换回来。
Algorithms and utilities that power the Material Design 3 (M3) color system, including choosing theme colors from images and creating tones of colors; all in a new color space.
See the main README for more information.
npm i @material/material-color-utilities
or yarn add @material/material-color-utilities
1import { HCT } from "@material/material-color-utilities"; 2 3// Simple demonstration of HCT. 4const color = HCT.fromInt(0xff4285f4); 5console.log(`Hue: ${color.hue}`); 6console.log(`Chrome: ${color.chroma}`); 7console.log(`Tone: ${color.tone}`); 8
1import { argbFromHex, themeFromSourceColor, applyTheme } from "@material/material-color-utilities"; 2 3// Get the theme from a hex color 4const theme = themeFromSourceColor(argbFromHex('#f82506'), [ 5 { 6 name: "custom-1", 7 value: argbFromHex("#ff0000"), 8 blend: true, 9 }, 10]); 11 12// Print out the theme as JSON 13console.log(JSON.stringify(theme, null, 2)); 14 15// Check if the user has dark mode turned on 16const systemDark = window.matchMedia("(prefers-color-scheme: dark)").matches; 17 18// Apply the theme to the body by updating custom properties for material tokens 19applyTheme(theme, {target: document.body, dark: systemDark}); 20
If using node make sure to use the following flag:
node --experimental-specifier-resolution=node
This repo is not accepting external contributions, but feature requests and bug reports are welcome on GitHub.
No vulnerabilities found.
Reason
all changesets reviewed
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
9 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 7
Reason
dependency not pinned by hash detected -- score normalized to 2
Details
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no SAST tool detected
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More