Coder Social home page Coder Social logo

ilariaventurini / colors-convert Goto Github PK

View Code? Open in Web Editor NEW
18.0 1.0 3.0 3.49 MB

๐Ÿฆš A simple colors library

Home Page: https://colors-convert-documentation.netlify.app/

License: MIT License

TypeScript 99.69% JavaScript 0.31%
rgba-color cmyk-color converts hsl hex colors colorspace rgb-color hsla hsla-colors

colors-convert's People

Contributors

daltonmenezes avatar dependabot[bot] avatar ilariaventurini avatar m4s7 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

colors-convert's Issues

[React v17] FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed

react: v17.2
node: 16.13.0
react-scripts: v5+

I test with the strict minimal for render component with and without colors-convert : without it, it works

import React from 'react';
import ReactDOM from 'react-dom';
import { stringToColor } from "colors-convert";

ReactDOM.render(
    <React.StrictMode>
        <div className>
            {(stringToColor("#000000"))}
        </div>
    </React.StrictMode>,
    document.getElementById('root')
);

full error


<--- Last few GCs --->

[6788:0000019EF28A5DE0]    65035 ms: Scavenge 2023.7 (2077.7) -> 2021.4 (2077.7) MB, 4.9 / 0.0 ms  (average mu = 0.182, current mu = 0.150) allocation failure
[6788:0000019EF28A5DE0]    65044 ms: Scavenge 2024.7 (2078.0) -> 2023.0 (2078.5) MB, 5.1 / 0.0 ms  (average mu = 0.182, current mu = 0.150) allocation failure
[6788:0000019EF28A5DE0]    65058 ms: Scavenge 2025.8 (2078.5) -> 2024.0 (2087.5) MB, 7.6 / 0.0 ms  (average mu = 0.182, current mu = 0.150) allocation failure


<--- JS stacktrace --->

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
 1: 00007FF7C8EE013F v8::internal::CodeObjectRegistry::~CodeObjectRegistry+112495
 2: 00007FF7C8E6F396 DSA_meth_get_flags+65526
 3: 00007FF7C8E7024D node::OnFatalError+301
 4: 00007FF7C97A19EE v8::Isolate::ReportExternalAllocationLimitReached+94
 5: 00007FF7C978BECD v8::SharedArrayBuffer::Externalize+781
 6: 00007FF7C962F61C v8::internal::Heap::EphemeronKeyWriteBarrierFromCode+1468
 7: 00007FF7C963C2C9 v8::internal::Heap::PublishPendingAllocations+1129
 8: 00007FF7C963929A v8::internal::Heap::PageFlagsAreConsistent+2842
 9: 00007FF7C962BF19 v8::internal::Heap::CollectGarbage+2137
10: 00007FF7C962A0D0 v8::internal::Heap::AllocateExternalBackingStore+2000
11: 00007FF7C964EA06 v8::internal::Factory::NewFillerObject+214
12: 00007FF7C9381CD5 v8::internal::DateCache::Weekday+1797
13: 00007FF7C982F3E1 v8::internal::SetupIsolateDelegate::SetupHeap+494417
14: 0000019EF4DC9A8B

I have some issues with postcss, maybe it's only postcss issues, I dont know.
I will directly add the main code to my project for seeing whats happen : o .

PS: i get the code and found in line 30 on hex.ts the only error I have (my configuration of tsconfig allow "any" or somes tricks with "!")

// return RegExpMatchArray | null  so dangerous to desconstruct and make me error because you cannot deconstruct something null
  const [r, g, b, a] = chunkString(hexLongWtihoutHashtag, 2) 
  • it's work when put your files in my project : (

SyntaxError: Unexpected token 'export'

Hi, I'm not being able to use colors-convert using typescript with ts-node-dev. I'm getting the following error:

yarn dev
yarn run v1.22.10
$ tsnd --respawn --transpile-only --ignore-watch node_modules src/index.ts
[INFO] 22:18:37 ts-node-dev ver. 1.1.6 (using ts-node ver. 9.1.1, typescript ver. 4.3.4)
/Users/daltonmenezes/projetos/github/new-aura/node_modules/colors-convert/dist/index.js:1
export { isHex, isRgb, isRgba, isCmyk, isHsl, isHsla, isColor } from './lib/types/isType';
^^^^^^

SyntaxError: Unexpected token 'export'
    at Object.compileFunction (node:vm:355:18)
    at wrapSafe (node:internal/modules/cjs/loader:1022:15)
    at Module._compile (node:internal/modules/cjs/loader:1056:27)
    at Module._compile (/Users/daltonmenezes/projetos/github/new-aura/node_modules/source-map-support/source-map-support.js:547:25)
    at Module._extensions..js (node:internal/modules/cjs/loader:1121:10)
    at Object.nodeDevHook [as .js] (/Users/daltonmenezes/projetos/github/new-aura/node_modules/ts-node-dev/lib/hook.js:63:13)
    at Module.load (node:internal/modules/cjs/loader:972:32)
    at Function.Module._load (node:internal/modules/cjs/loader:813:14)
    at Module.require (node:internal/modules/cjs/loader:996:19)
    at require (node:internal/modules/cjs/helpers:92:18)
[ERROR] 22:18:37 SyntaxError: Unexpected token 'export'

No examples?

I am trying to use this in a requirement to change color name like 'red' to rgb then make a color pallette like lighter and darker, but i don't see much of examples on how to do that. API page only mentions functions, that does not even tell how to do simple import {a, b} from 'pkg'; I saw a demo folder, that does not have anything.

So i would request that we add good detailing with examples.

I have user input text box they can type in any format of color. Can we have a function called:
ConvertAnythingToColorName
Or
ConvertAnythingToStandardFormat

string to Color ?

Hi;

I read the doc but ... none function about construct Color with a string ......

SyntaxError: Unexpected token 'export'

I am unable to use the library because of the following error

export { isHex, isRgb, isRgbString, isRgba, isRgbaString, isCmyk, isCmykString, isHsl, isHslString, isHsla, isHslaString, isColor, } from './lib/types/isType';
^^^^^^

SyntaxError: Unexpected token 'export'
    at Object.compileFunction (node:vm:352:18)
    at wrapSafe (node:internal/modules/cjs/loader:1025:15)
    at Module._compile (node:internal/modules/cjs/loader:1059:27)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1124:10)
    at Module.load (node:internal/modules/cjs/loader:975:32)
    at Function.Module._load (node:internal/modules/cjs/loader:816:12)
    at Module.require (node:internal/modules/cjs/loader:999:19)
    at require (node:internal/modules/cjs/helpers:93:18)
    at Module._compile (node:internal/modules/cjs/loader:1095:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1124:10)
    at Module.load (node:internal/modules/cjs/loader:975:32)
    at Function.Module._load (node:internal/modules/cjs/loader:816:12)
    at Module.require (node:internal/modules/cjs/loader:999:19)
    at require (node:internal/modules/cjs/helpers:93:18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.