Giter VIP home page Giter VIP logo

do0dle-colors's People

Contributors

dependabot[bot] avatar do0dleman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

meodai oddadmix

do0dle-colors's Issues

:bug: Error: Cannot find module '../conversionFunctions/OkLChToRgb.js'

Hello, was trying to use this library but it seems it's broken for me unfortunately.

Here's how I'm using it:

import { Color } from 'do0dle-colors';

type ColorGenerationMethods = 'analogous' | 'complimentary' | 'monochromatic' | 'quadratic' | 'triadic' | 'tetraidic' | 'split complimentary';
const generateComplimentaryColorForTheme = (
  lightTheme = true,
  colors = 2,
  method: ColorGenerationMethods = 'split complimentary'
) => {
  return new Color(lightTheme ? '#1d4568' : '#f0f0f0')
    .getColorScheme(colors, method)
    .map(c => c.getCssHex())
}

const randomColorHex = (withComplimentary = false) => {
  if (withComplimentary) {
    return generateComplimentaryColorForTheme(true, 2, 'complimentary');
  }
  return generateComplimentaryColorForTheme(true, 1, 'monochromatic');
}

const randomColorCSS = (withComplimentary = false) => {
  if (withComplimentary) {
    const [color, complimentary] = randomColorHex(withComplimentary);
    return `background-color: ${color}; color: ${complimentary};`;
  }
  return `background-color: ${randomColorHex()};`;
}

However when I run my app, and it calls the conversion functions, we get an full crash with the following error:

node:internal/modules/cjs/loader:1202
  const err = new Error(message);
              ^

Error: Cannot find module '../conversionFunctions/OkLChToRgb.js'
Require stack:
- /home/navi/Code/Veritas/node_modules/do0dle-colors/lib/color/color.js
- /home/navi/Code/Veritas/node_modules/do0dle-colors/lib/index.js

If you need any further info, let me know. Thank you!

Compiled js file name issue in build

Firstly, amazing work on the package, it's nice and unique.

I am getting a build issue when trying to build my overall project on ubuntu machine.

    at new NodeError (node:internal/errors:371:5)
    at finalizeResolution (node:internal/modules/esm/resolve:418:11)
    at moduleResolve (node:internal/modules/esm/resolve:981:10)
    at defaultResolve (node:internal/modules/esm/resolve:1078:11)
    at ESMLoader.resolve (node:internal/modules/esm/loader:530:30)
    at ESMLoader.getModuleJob (node:internal/modules/esm/loader:251:18)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:79:40)
    at link (node:internal/modules/esm/module_job:78:36)

Looks like the generated file lib/conversionFunctions/OkLChToRgb.js in the published version https://registry.npmjs.org/do0dle-colors/-/do0dle-colors-2.1.3.tgz is named as OkLChtoRgb.js not OkLChToRgb.js as referenced in lib/color/color.js

I would appreciate if you could fix that in a new version.

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.