Coder Social home page Coder Social logo

kurage-utils's Introduction

Kurage Utils

Collection of utility functions.

Installation

npm i @kiyotd/kurage-utils
yarn add @kiyotd/kurage-utils
pnpm add @kiyotd/kurage-utils

Examples

  • NumberUtils.map

    数値を別の範囲にマッピング

    import { NumberUtils } from "@kiyotd/kurage-utils";
    
    // 元の範囲が0から100で、新しい範囲が0から1の場合
    NumberUtil.map(50, 0, 100, 0, 1) // 0.5
    
    // 元の範囲が0から100で、新しい範囲が0から10の場合
    NumberUtil.map(50, 0, 100, 0, 10) // 5
  • calculateRgbaForOpacity

    透明度を考慮したRGBA値を計算

    import { calculateRgbaForOpacity } from '@kiyotd/kurage-utils';
    
    // "rgb(80,209,173)" に限りなく近い色で、透明度を 0.75 にした場合の RGBA 値を取得
    calculateRgbaForOpacity('80,209,173', 0.75); // rgba(22,194,146,0.75)
    
    // "#50d1ad" に限りなく近い色で、透明度を 0.75 にした場合の RGBA 値を取得  
    calculateRgbaForOpacity('#50d1ad', 0.75); // rgba(22,194,146,0.75)

etc...

Documentation

kurage-utils.vercel.app

License

MIT

kurage-utils's People

Contributors

kiyotd avatar

Watchers

 avatar

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.