fff 1.0.0 fff: ^1.0.0 copied to clipboard
Dart package for convenient work with color. It will allow you to convert colors between rgb, rgba and hex formats. Also it can parse color from strings specified formats and from list of color compon [...]
import 'package:fff/color.dart';
import 'package:fff/parser.dart';
main() {
// Create color object from hex-string
Color color = ColorParser('#afa43e');
// get color components
print(color.red); // 175
print(color.green); // 164
print(color.blue); // 62
// output color as string
print(color.toHexString()); // afa43e
print(color.toRgbString('[%r, %G, %b]')); // rgb(175, 164, 62)
print(color.toRgbaString()); // rgba(175, 164, 62, 1.0)
print(color.toString()); // rgb(175, 164, 62)s
print(color.toHexString('#%R%G%B')); // #AFA43E
}