Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
magic-color
Advanced tools
Magic color creator.
pnpm add magic-color
A lot of color tool functions for you to use, providing easy conversion, generation, parsing, comparison, operation and other functions.
import { hexTorgb, rgbTohex } from 'magic-color'
hexTorgb('#fff') // [255, 255, 255]
rgbTohex('rgb(255, 255, 255)') // '#fff'
And more...
Well, you can use it to create a theme color.
import { theme } from 'magic-color'
theme('#9955ff')
// Will output:
// {
// "50": "#faf7ff",
// "100": "#f5eeff",
// "200": "#e6d5ff",
// "300": "#d6bbff",
// "400": "#b888ff",
// "500": "#9955ff",
// "600": "#8a4de6",
// "700": "#5c3399",
// "800": "#452673",
// "900": "#2e1a4d",
// "950": "#1f1133",
// }
And you can custom it with themeOptions
.
export interface ThemeOptions {
/**
* Output color type
*
* @default same type as input
*/
type?: ColorType
/**
* Custom render output color
*
* @param meta [name, color]
* @returns [CustomedName, CustomedColor]
*/
render?: (meta: [string, string]) => [string, string]
}
import { theme } from 'magic-color'
theme('#9955ff', {
type: 'rgb',
render: (meta) => {
return [
`--color-primary-${meta[0]}`,
meta[1].replace(/rgb\((.*)\)/, '$1').replace(/,/g, ''),
]
},
})
// Will output:
// {
// "--color-primary-50": "250 247 255",
// "--color-primary-100": "245 238 255",
// "--color-primary-200": "230 213 255",
// "--color-primary-300": "214 187 255",
// "--color-primary-400": "184 136 255",
// "--color-primary-500": "153 85 255",
// "--color-primary-600": "138 77 230",
// "--color-primary-700": "92 51 153",
// "--color-primary-800": "69 38 115",
// "--color-primary-900": "46 26 77",
// "--color-primary-950": "31 17 51",
// }
FAQs
Magic color creator.
The npm package magic-color receives a total of 9 weekly downloads. As such, magic-color popularity was classified as not popular.
We found that magic-color demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.