colorfy 2.1.0
colorfy: ^2.1.0 copied to clipboard
Terminal string styling done right with Dart.
import 'package:colorfy/colorfy.dart';
void main() {
print(color('Error').red().bold());
print(color('Warning').yellow().italic());
print(color('Success').green().underline().bold());
print(color('Hello ').red() + 'World '+ color('!').green().bold());
print(color('Hello World ').blue().bgRed().bold());
print(color('✔ SUCCESS', ['-Operation completed']).green().bold());
// Nest styles
print(color('hello ', [color('world').bgRed(), '!']) );
print(
color("i am green line ", [
color("witth a blue substring ").bgBlue().underline(),
'that become again!'
]).green()
);
print('''
CPU : ${color('90%').red()}
RAM : ${color('70%').yellow()}
DISK: ${color('50%').green()}
''');
// Use RGB colors in terminal emulators that support it.
print(color('Underlined reddish color').rgb(123, 45, 67).bold());
print(color('Bold Grey').hex('#DEADED'));
//themes
final error = color('').red().bold();
final warning = color('').hex('#FFA500');
print(color(''));
print(error.apply('This is an error message!'));
print(warning.apply('This is a warning message!'));
final name = 'KABULU';
print(color('Hello %s').green().format([name]));
}