Socket
Socket
Sign inDemoInstall

dxf-viewer

Package Overview
Dependencies
5
Maintainers
1
Versions
34
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.5 to 1.0.6

2

package.json
{
"name": "dxf-viewer",
"version": "1.0.5",
"version": "1.0.6",
"description": "JavaScript DXF file viewer",

@@ -5,0 +5,0 @@ "main": "src/index.js",

@@ -57,2 +57,3 @@ # DXF viewer

* Block instancing in a grid. Grid attributes are ignored now.
* Dimensions
* Many less commonly used DXF features.

@@ -211,3 +211,3 @@ import * as three from "three"

for (const lyr of this.layers.values()) {
result.push({name: lyr.name, color: lyr.color})
result.push({name: lyr.name, color: this._TransformColor(lyr.color)})
}

@@ -577,19 +577,30 @@ return result

}
/* Just black and white inversion. */
const bkgLum = Luminance(this.clearColor)
if (color === 0xffffff && bkgLum >= 0.8) {
return 0
}
if (color === 0 && bkgLum <= 0.2) {
return 0xffffff
}
if (!this.options.colorCorrection) {
/* Just black and white inversion. */
const bkgLum = Luminance(this.clearColor)
if (color === 0xffffff && bkgLum >= 0.8) {
return 0
return color
}
const fgLum = Luminance(color)
const MIN_TARGET_RATIO = 1.5
const contrast = ContrastRatio(color, this.clearColor)
const diff = contrast >= 1 ? contrast : 1 / contrast
if (diff < MIN_TARGET_RATIO) {
let targetLum
if (bkgLum > 0.5) {
targetLum = bkgLum / 2
} else {
targetLum = bkgLum * 2
}
if (color === 0 && bkgLum <= 0.2) {
return 0xffffff
if (targetLum > fgLum) {
color = Lighten(color, targetLum / fgLum)
} else {
color = Darken(color, fgLum / targetLum)
}
return color
}
//XXX not implemented
// const MIN_TARGET_RATIO = 1.5
// const contrast = ContrastRatio(color, this.clearColor)
// const diff = contrast >= 1 ? contrast : 1 / contrast
// if (diff < MIN_TARGET_RATIO) {
// }
return color

@@ -596,0 +607,0 @@ }

SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc