hybrid_hex_color_converter 0.0.1 copy "hybrid_hex_color_converter: ^0.0.1" to clipboard
hybrid_hex_color_converter: ^0.0.1 copied to clipboard

Hybrid hex Color, Allows you to convert hexadecimal strings into flutters Color property and vice versa

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:hybrid_hex_color_converter/hybrid_hex_color_converter.dart';

void main() {
  /// Test to see the conversion from hex to color
  Color redColor = HexColor.fromHex('#F44336');
  Color greenColor = HexColor.fromHex('#4CAF50');
  Color blueColor = HexColor.fromHex('#2196F3');
  Color whiteColor = HexColor.fromHex('#ffffff');
  Color blackColor = HexColor.fromHex('#000000');
  Color pinkColor = HexColor.fromHex('#E91E63');

  print(redColor);
  print(greenColor);
  print(blueColor);
  print(whiteColor);
  print(blackColor);
  print(pinkColor);

  ///Conversion withouth hash sign
  String blueString = Colors.blue.toHex(leadingHashSign: false);
  String redString = Colors.red.toHex(leadingHashSign: false);
  String purpleString = Colors.purple.toHex(leadingHashSign: false);

  print(blueString);
  print(redString);
  print(purpleString);

  /// Conversion with hash sign
  String greenWithHash = Colors.green.toHex();
  String orangeWithHash = Colors.orange.toHex();
  String pinkWithHash = Colors.pink.toHex();

  print(greenWithHash);
  print(orangeWithHash);
  print(pinkWithHash);
}
5
likes
0
points
139
downloads

Publisher

verified publisherrudo.es

Weekly Downloads

Hybrid hex Color, Allows you to convert hexadecimal strings into flutters Color property and vice versa

Homepage

License

unknown (license)

Dependencies

flutter

More

Packages that depend on hybrid_hex_color_converter