
Security News
CISA Extends MITRE Contract as Crisis Accelerates Alternative CVE Coordination Efforts
CISA extended MITRE’s CVE contract by 11 months, avoiding a shutdown but leaving long-term governance and coordination issues unresolved.
Note: if you want a reliable library use something like color instead.
/**
* Takes an `RGBColor` and converts it to `HSVColor`
*/
function RGBToHSV(color: RGBColor, is255?: boolean): HSVColor;
/**
* Takes an `HSVColor` and converts it to `RGBColor`
*/
function HSVToRGB(hsv: HSVColor, is100?: boolean): RGBColor;
/**
* Takes an `StringColor` and converts it to `RGBColor`,
* If input string is invalid `null` will be returned.
*/
function StringToRGB(input: string, return255?: boolean, alpha255?: boolean): RGBColor;
/**
* Takes an `StringColor` and converts it to `HSVColor`,
* If input string is invalid `null` will be returned.
*/
function StringToHVS(input: string, return255?: boolean, alpha255?: boolean): HSVColor;
/**
* Takes an `HSVColor` and converts it to `String` (HEX Format)
*/
function HSVToHEX(hsv: HSVColor, options?: {
type?: GetColorTypeHex;
isLong?: boolean;
}
/**
* Takes an `RGBColor` and converts it to `String` (HEX Format)
*/
function RGBToHEX(color: RGBColor, type?: GetColorTypeHex): string;
/**
* Represents a color in the rgb(a) format.
*
*
* Range `[0 - 1]`
*/
class RGBColor {
/**
* Range [0-1]
*/
r: number;
/**
* Range [0-1]
*/
g: number;
/**
* Range [0-1]
*/
b: number;
/**
* Range [0-1]
*/
a: number;
constructor(r: number, g: number, b: number, a?: number);
}
/**
* Represents a color in the hsv(a) format.
*
*
* Range `[h 0 - 360, v/s/a 0 - 1]`
*/
class HSVColor {
/**
* Range [0-360]
*/
h: number;
/**
* Range [0-100]
*/
s: number;
/**
* Range [0-100]
*/
v: number;
/**
* Range [0-1]
*/
a: number;
constructor(h: number, s: number, v: number, a?: number);
}
/**
* Represents a color in a string format.
* Valid strings are `#000 | #0000 | #000000 | #00000000`
* Or `rgb(0, 0, 0, 0) | rgba(0, 0, 0, 0, 0)` Range [rgb 0-255, a: 0-1]
*
*/
class StringColor {
color: string;
constructor(color: string);
}
function HandleGetHex(type: GetColorType, color: RGBColor, options?: GetColorOptions): string;
function ConvertString(input: string, return255?: boolean, alpha255?: boolean): RGBColor;
/**
* **assumes that the input is valid**
*/
function HandleConvertHexString(text: string, return255?: boolean, alpha255?: boolean): RGBColor;
function GetReadableTextColor(color: RGBColor | HSVColor | StringColor | string): RGBColor | HSVColor | "#000" | "#fff";
/**
* Shifts the hue of the `HSVColor` by the Value
*/
function ShiftHue(hsv: HSVColor, value: number): HSVColor;
type GetColorTypeHex = 'hex' | 'hex-short' | 'hex-without-alpha' | 'hex-without-alpha-short';
type GetColorType = 'rgb' | GetColorTypeHex | 'rgba' | 'object' | 'hsv';
interface GetColorOptions {
/**
* if true `#fff` will be output as `#FFF`
*/
UpperCaseHex: boolean;
}
function isValidHex(text: string): boolean;
function isValidRGB(text: string): boolean;
function GetReadableTextColor(color: RGBColor | HSVColor | StringColor | string): RGBColor | HSVColor | "#000" | "#fff";
/**
* Shifts the hue of the `HSVColor` by the Value
*/
function ShiftHue(hsv: HSVColor, value: number): HSVColor;
/**Returns the hex value of the color string or the input string */
function convertCssColorToHex(color: string): string;
function isValidStringColor(input: string): string;
Generated with suf-cli
Copyright (c) 2020 Leonard Grosoli Licensed under the MIT license.
FAQs
Simple color library.
The npm package s.color receives a total of 0 weekly downloads. As such, s.color popularity was classified as not popular.
We found that s.color demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.
Security News
CISA extended MITRE’s CVE contract by 11 months, avoiding a shutdown but leaving long-term governance and coordination issues unresolved.
Product
Socket's Rubygems ecosystem support is moving from beta to GA, featuring enhanced security scanning to detect supply chain threats beyond traditional CVEs in your Ruby dependencies.
Research
The Socket Research Team investigates a malicious npm package that appears to be an Advcash integration but triggers a reverse shell during payment success, targeting servers handling transactions.