Skip to content

v0.1.2

Choose a tag to compare

@willybrauner willybrauner released this 13 Jun 15:03
· 16 commits to main since this release
  • add cssVariable getter shortcut. default target is document.documentElement.
     type Strings = "--a" | "-b"
     const value = cssVariable<Strings>("--a")     // ok
     const value =  cssVariable<Strings>("--c")    // ts error
  • add interpolateColor()
    // rgb
    expect(interpolateColor("rgb(0, 0, 0)", "rgb(255, 255, 255)", 0.5)).toBe("rgb(128, 128, 128)")
    //hex
    expect(interpolateColor("#000000", "#ffffff", 0.5)).toBe("#808080")
    // mix
    expect(interpolateColor("rgb(0, 0, 0)","#ffffff", 0.5)).toBe("rgb(128, 128, 128)")
  • add isAppleDevice()
  • add randomItemFromArray()