@ant-design/fast-color
Advanced tools
Comparing version 2.0.5 to 2.0.6
@@ -0,1 +1,2 @@ | ||
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty"; | ||
const round = Math.round; | ||
@@ -47,39 +48,33 @@ | ||
export class FastColor { | ||
/** | ||
* All FastColor objects are valid. So isValid is always true. This property is kept to be compatible with TinyColor. | ||
*/ | ||
isValid = true; | ||
/** | ||
* Red, R in RGB | ||
*/ | ||
r = 0; | ||
/** | ||
* Green, G in RGB | ||
*/ | ||
g = 0; | ||
/** | ||
* Blue, B in RGB | ||
*/ | ||
b = 0; | ||
/** | ||
* Alpha/Opacity, A in RGBA/HSLA | ||
*/ | ||
a = 1; | ||
// HSV privates | ||
_h; | ||
_s; | ||
_l; | ||
_v; | ||
// intermediate variables to calculate HSL/HSV | ||
_max; | ||
_min; | ||
_brightness; | ||
constructor(input) { | ||
/** | ||
* All FastColor objects are valid. So isValid is always true. This property is kept to be compatible with TinyColor. | ||
*/ | ||
_defineProperty(this, "isValid", true); | ||
/** | ||
* Red, R in RGB | ||
*/ | ||
_defineProperty(this, "r", 0); | ||
/** | ||
* Green, G in RGB | ||
*/ | ||
_defineProperty(this, "g", 0); | ||
/** | ||
* Blue, B in RGB | ||
*/ | ||
_defineProperty(this, "b", 0); | ||
/** | ||
* Alpha/Opacity, A in RGBA/HSLA | ||
*/ | ||
_defineProperty(this, "a", 1); | ||
// HSV privates | ||
_defineProperty(this, "_h", void 0); | ||
_defineProperty(this, "_s", void 0); | ||
_defineProperty(this, "_l", void 0); | ||
_defineProperty(this, "_v", void 0); | ||
// intermediate variables to calculate HSL/HSV | ||
_defineProperty(this, "_max", void 0); | ||
_defineProperty(this, "_min", void 0); | ||
_defineProperty(this, "_brightness", void 0); | ||
/** | ||
* Always check 3 char in the object to determine the format. | ||
@@ -86,0 +81,0 @@ * We not use function in check to save bundle size. |
"use strict"; | ||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default; | ||
Object.defineProperty(exports, "__esModule", { | ||
@@ -7,2 +8,3 @@ value: true | ||
exports.FastColor = void 0; | ||
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty")); | ||
const round = Math.round; | ||
@@ -54,39 +56,33 @@ | ||
class FastColor { | ||
/** | ||
* All FastColor objects are valid. So isValid is always true. This property is kept to be compatible with TinyColor. | ||
*/ | ||
isValid = true; | ||
/** | ||
* Red, R in RGB | ||
*/ | ||
r = 0; | ||
/** | ||
* Green, G in RGB | ||
*/ | ||
g = 0; | ||
/** | ||
* Blue, B in RGB | ||
*/ | ||
b = 0; | ||
/** | ||
* Alpha/Opacity, A in RGBA/HSLA | ||
*/ | ||
a = 1; | ||
// HSV privates | ||
_h; | ||
_s; | ||
_l; | ||
_v; | ||
// intermediate variables to calculate HSL/HSV | ||
_max; | ||
_min; | ||
_brightness; | ||
constructor(input) { | ||
/** | ||
* All FastColor objects are valid. So isValid is always true. This property is kept to be compatible with TinyColor. | ||
*/ | ||
(0, _defineProperty2.default)(this, "isValid", true); | ||
/** | ||
* Red, R in RGB | ||
*/ | ||
(0, _defineProperty2.default)(this, "r", 0); | ||
/** | ||
* Green, G in RGB | ||
*/ | ||
(0, _defineProperty2.default)(this, "g", 0); | ||
/** | ||
* Blue, B in RGB | ||
*/ | ||
(0, _defineProperty2.default)(this, "b", 0); | ||
/** | ||
* Alpha/Opacity, A in RGBA/HSLA | ||
*/ | ||
(0, _defineProperty2.default)(this, "a", 1); | ||
// HSV privates | ||
(0, _defineProperty2.default)(this, "_h", void 0); | ||
(0, _defineProperty2.default)(this, "_s", void 0); | ||
(0, _defineProperty2.default)(this, "_l", void 0); | ||
(0, _defineProperty2.default)(this, "_v", void 0); | ||
// intermediate variables to calculate HSL/HSV | ||
(0, _defineProperty2.default)(this, "_max", void 0); | ||
(0, _defineProperty2.default)(this, "_min", void 0); | ||
(0, _defineProperty2.default)(this, "_brightness", void 0); | ||
/** | ||
* Always check 3 char in the object to determine the format. | ||
@@ -93,0 +89,0 @@ * We not use function in check to save bundle size. |
{ | ||
"name": "@ant-design/fast-color", | ||
"version": "2.0.5", | ||
"version": "2.0.6", | ||
"description": "fast and small color class", | ||
@@ -49,3 +49,3 @@ "keywords": [ | ||
"@types/jest": "^29.5.12", | ||
"@types/node": "^20.14.2", | ||
"@types/node": "^22.1.0", | ||
"@umijs/fabric": "^4.0.1", | ||
@@ -52,0 +52,0 @@ "color2k": "^2.0.3", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
43946
1302
312058