Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@waku-objects/luminance

Package Overview
Dependencies
Maintainers
2
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@waku-objects/luminance - npm Package Compare versions

Comparing version 1.2.0 to 2.0.0

1

.eslintrc.json

@@ -18,3 +18,2 @@ {

"no-duplicate-imports": "off",
"@typescript-eslint/no-duplicate-imports": ["error"],
"new-cap": "off",

@@ -21,0 +20,0 @@ "unicorn/filename-case": [

12

CHANGELOG.md
# Changelog
## [2.0.0](https://github.com/logos-innovation-lab/luminance/compare/v1.2.0...v2.0.0) (2023-07-21)
### ⚠ BREAKING CHANGES
* typescript should be dev depency ([#13](https://github.com/logos-innovation-lab/luminance/issues/13))
### Bug Fixes
* expose types ([#16](https://github.com/logos-innovation-lab/luminance/issues/16)) ([9b155b3](https://github.com/logos-innovation-lab/luminance/commit/9b155b3d41ee5a87c9476880a3f021dfa5302b64))
* typescript should be dev depency ([#13](https://github.com/logos-innovation-lab/luminance/issues/13)) ([738ca99](https://github.com/logos-innovation-lab/luminance/commit/738ca99db531e0a968c4c6ce968c8aa950c84c16))
## [1.2.0](https://github.com/logos-innovation-lab/luminance/compare/v1.1.0...v1.2.0) (2023-07-21)

@@ -4,0 +16,0 @@

{
"name": "@waku-objects/luminance",
"version": "1.2.0",
"version": "2.0.0",
"description": "Library for getting manipulating colors",
"main": "dist/index.js",
"types": "dist/types/index.d.ts",
"author": "Logos Innovation Lab",
"license": "MIT",
"devDependencies": {
"@types/node": "^18.11.9",
"@typescript-eslint/eslint-plugin": "^5.42.1",
"@typescript-eslint/parser": "^5.42.1",
"@types/node": "^20.4.2",
"@typescript-eslint/eslint-plugin": "^6.1.0",
"@typescript-eslint/parser": "^6.1.0",
"cross-env": "^7.0.3",
"eslint": "^8.27.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-unicorn": "^44.0.2",
"eslint": "^8.45.0",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-prettier": "^5.0.0",
"eslint-plugin-unicorn": "^48.0.0",
"knip": "^2.16.0",
"prettier": "^2.8.0",
"rimraf": "^3.0.2",
"prettier": "^3.0.0",
"rimraf": "^5.0.1",
"typescript": "^5.1.6",
"vitest": "^0.33.0"
},
"dependencies": {
"typescript": "^5.1.6"
},
"scripts": {

@@ -31,6 +30,6 @@ "build": "rimraf dist && tsc -p tsconfig.json && npm run build:types",

"test:unit": "vitest",
"lint": "prettier --plugin-search-dir . --check . && eslint .",
"format": "prettier --plugin-search-dir . --write .",
"lint": "prettier --check . && eslint .",
"format": "prettier --write .",
"knip": "knip"
}
}

@@ -62,12 +62,12 @@ # @waku-objects/luminance

function hexToRgb(hex: string): RGB
function rgbToHex({ r, g, b }: RGB): string
function hslToRgb({ h, s, l }: HSL): RGB
function rgbToHsl({ r, g, b }: RGB): HSL
function rgbToHex(rgb: RGB): string
function hslToRgb(hsl: HSL): RGB
function rgbToHsl(rgb: RGB): HSL
// Calculate luminance
function calculateLuminance(rgbOrHex: RGB | string): number
function calculateLuminance(color: RGB | string): number
// Find color with same hue that would be closest to a targetLuminance (uses bisection algorithm with at most 100 iterations)
function getClosestColor(
hex: string,
sourceColor: string,
targetLuminance: number,

@@ -79,3 +79,3 @@ targetPrecision?: number,

function getClosestColorBisection(
hex: string,
sourceColor: string,
targetLuminance: number,

@@ -88,3 +88,3 @@ targetPrecision?: number,

function getClosestColorNewton(
hex: string,
sourceColor: string,
targetLuminance: number,

@@ -91,0 +91,0 @@ targetPrecision?: number,

Sorry, the diff of this file is not supported yet

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