This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:ui'; | |
import 'package:flutter/material.dart'; | |
// Converts a hex, rgb, or rgba color string to Color object. Works with opacity values as well. | |
// e.g.: | |
// "#000" -> Color(0xff000000) | |
// "#cc3333" -> Color(0xffcc3333) | |
// "#cc3333dd" -> Color(0xddcc3333) | |
// "rgb(204, 44, 81)" -> Color(0xffcc2c51) | |
// "rgba(204, 44, 81, 0.20)" -> Color(0x33cc2c51) |