Socket
Socket
Sign inDemoInstall

@mathigon/core

Package Overview
Dependencies
Maintainers
1
Versions
62
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mathigon/core - npm Package Compare versions

Comparing version 0.6.2 to 0.6.3

src/itarray.ts

12

dist/core.cjs.js

@@ -363,3 +363,4 @@ 'use strict';

const rgbaRegex = /rgba?\(([0-9,]+), ?([0-9,]+), ?([0-9,]+)(, ?([0-9,]+))?\)/;
const rainbow = ['#22ab24', '#0f82f2', '#cd0e66', '#fd8c00'];
const rainbow = ['#22ab24', '#009ea6', '#0f82f2', '#6d3bbf',
'#cd0e66', '#eb4726', '#fd8c00'];
function pad2(str) {

@@ -462,5 +463,10 @@ return str.length === 1 ? '0' + str : str;

/** Generates a rainbow gradient with a given number of steps. */
static gradient(from, to, steps) {
return tabulate(x => getColourAt([from, to], x / (steps - 1)), steps);
static gradient(colors, steps) {
return tabulate(x => getColourAt(colors, x / (steps - 1)), steps);
}
static shades(color, steps, range = 0.5) {
const light = Color.mix('#fff', color, range);
const dark = Color.mix('#000', color, range);
return Color.gradient([light, color, dark], steps);
}
/** Linearly interpolates two colours or hex strings. */

@@ -467,0 +473,0 @@ static mix(c1, c2, p = 0.5) {

@@ -359,3 +359,4 @@ // =============================================================================

const rgbaRegex = /rgba?\(([0-9,]+), ?([0-9,]+), ?([0-9,]+)(, ?([0-9,]+))?\)/;
const rainbow = ['#22ab24', '#0f82f2', '#cd0e66', '#fd8c00'];
const rainbow = ['#22ab24', '#009ea6', '#0f82f2', '#6d3bbf',
'#cd0e66', '#eb4726', '#fd8c00'];
function pad2(str) {

@@ -458,5 +459,10 @@ return str.length === 1 ? '0' + str : str;

/** Generates a rainbow gradient with a given number of steps. */
static gradient(from, to, steps) {
return tabulate(x => getColourAt([from, to], x / (steps - 1)), steps);
static gradient(colors, steps) {
return tabulate(x => getColourAt(colors, x / (steps - 1)), steps);
}
static shades(color, steps, range = 0.5) {
const light = Color.mix('#fff', color, range);
const dark = Color.mix('#000', color, range);
return Color.gradient([light, color, dark], steps);
}
/** Linearly interpolates two colours or hex strings. */

@@ -463,0 +469,0 @@ static mix(c1, c2, p = 0.5) {

{
"name": "@mathigon/core",
"version": "0.6.2",
"version": "0.6.3",
"description": "TypeScript utilities library containing function wrappers, string and array helper functions, event classes and color utilities.",

@@ -5,0 +5,0 @@ "keywords": [

@@ -14,3 +14,4 @@ // =============================================================================

const rainbow = ['#22ab24', '#0f82f2', '#cd0e66', '#fd8c00'];
const rainbow = ['#22ab24', '#009ea6', '#0f82f2', '#6d3bbf',
'#cd0e66', '#eb4726', '#fd8c00'];

@@ -132,6 +133,12 @@

/** Generates a rainbow gradient with a given number of steps. */
static gradient(from: Color|string, to: Color|string, steps: number) {
return tabulate(x => getColourAt([from, to], x / (steps - 1)), steps);
static gradient(colors: (Color|string)[], steps: number) {
return tabulate(x => getColourAt(colors, x / (steps - 1)), steps);
}
static shades(color: Color|string, steps: number, range = 0.5) {
const light = Color.mix('#fff', color, range);
const dark = Color.mix('#000', color, range);
return Color.gradient([light, color, dark], steps);
}
/** Linearly interpolates two colours or hex strings. */

@@ -138,0 +145,0 @@ static mix(c1: Color|string, c2: Color|string, p = 0.5) {

@@ -76,3 +76,3 @@ // =============================================================================

let resolve: ((value: T | PromiseLike<T>) => void) = () => undefined;
let reject: ((reason: any) => void) = () => undefined;
let reject: ((reason?: any) => void) = () => undefined;

@@ -79,0 +79,0 @@ const promise = new Promise<T>((_resolve, _reject) => {

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