0.2.1 • Published 7 years ago

jinjin v0.2.1

Weekly downloads
1
License
MIT
Repository
github
Last release
7 years ago

jinjin

installation

use npm or yarn

npm i jinjin -S // use npm
yarn add jinjin // use yarn

in es6

import jin from "jinjin"

use script

<script src="./node_modules/jin/jin.js" />

how to run example

npm run dev.eg // use npm
yarn dev.eg // use yarn

api

jin

you can import from "jinjin" in common js , for use script tag and jin have already explored to window.

  • type function
  • input (String) color code of hex / (Number, Number, Number) r, g, b
  • return Color instance usage
let white = jin("#fff")
let black = jin(0, 0, 0)

setHSB

  • type function
  • input Object ({h, s, b})
  • return Color instance

(class) Color

properties:

  • rgb Object ({r, g, b})
  • hsb Object ({h, s, b})

run test

npm test // use npm
yarn test // use yarn
jin(55, 31, 116).setHSB({h: this.hsb.h++}) // get color of 1 degree greater than the former in hue