New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

colors-formater

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

colors-formater - npm Package Compare versions

Comparing version 0.0.8 to 0.0.9-alpha

30

index.js
"use strict";
/**
*
*
* @example

@@ -9,14 +9,14 @@ * // Init with hexa color

* const color = Colors('#123')
* const color = Colors('#ABCDEF')
*
* const color = Colors('#ABCDEF')
*
* // Init with RGB object
* const color = Colors({ r:255, g:23, b: 467 })
*
* const color = Colors({ r:255, g:23, b: 467 })
*
* // Init with RGB string
* const color = Colors('rgb(23, 45, 67))
* const color = Colors('rgba(23, 45, 67, 0.4))
*
*
* // Init with HSL object
* const color = Colors({ h:255, s:23, l: 467 })
*
*
* //Conversions

@@ -28,3 +28,3 @@ * color.toHex()

* color.toHSLString()
*
*
* // Verifications

@@ -36,3 +36,3 @@ * color.isHex()

* color.isDark()
*
*
* // Calculations

@@ -45,3 +45,3 @@ * // These functions changes internal initial color. Always prefer using

*/
var HandleColors = require('./dist/HandleColors');
var HandleColors = require("./dist/HandleColors");

@@ -57,2 +57,8 @@ function Colors(color) {

},
toRGBA: function toRGBA(alpha) {
return { ...RGB, alpha };
},
toRGBAString: function toRGBAString(alpha) {
return `rgba(${RGB.red}, ${RGB.green}, ${RGB.blue}, ${alpha} )`;
},
toRGBString: function toRGBString() {

@@ -81,6 +87,6 @@ return HandleColors.convertRGBObjectToString(RGB);

return HandleColors.isValid(RGB);
}
},
};
}
module.exports = Colors;
module.exports = Colors;

4

package.json
{
"name": "colors-formater",
"description": "A project to handle colors in javascript",
"version": "0.0.8",
"version": "0.0.9-alpha",
"main": "index.js",

@@ -29,2 +29,2 @@ "repository": {

}
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc