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 }
Parse RGB CSS strings into `RGB` objects
<script type="module">
import fantasyColorFromRgb from 'https://cdn.skypack.dev/@fantasy-color/from-rgb';
</script>
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 }