@fantasy-color/from-rgb

Parse RGB CSS strings into `RGB` objects

Usage no npm install needed!

<script type="module">
  import fantasyColorFromRgb from 'https://cdn.skypack.dev/@fantasy-color/from-rgb';
</script>

README

@fantasy-color/from-rgb

Parse a CSS RGB string into a RGB object.

type fromRgb = (rgb: string) => RGB

Example usage:

import fromRgb from '@fantasy-color/from-rgb'

fromRgb('rgb(0, 250, 10)')
// { red: 0, green: 250, blue: 10 }