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

Flutter package to convert hex String to Color() , and Color() to hex String

color_hex: #

A package helps you to convert Hex color to Color() , and convert Color() to hex color


# 👨‍💻 Developed by: #

profile

Nasr Al-Rahbi @abom_me

👨🏻‍💻 Find me in : #

Twitter Instagram LinkedIn Stack Overflow



🔥 Get Started : #

Pubspec changes:

      dependencies:
        color_hex: <last_verison>

How to use it? #

you can add it to your text or color as extension like this :

  Color color=Colors.deepPurple;
  String hex="#000000";
  /// here we convert the hex to color and the color to hex 
Text(color.convertToHex.hex,style: TextStyle(color: hex.convertToColor),),

Another way you can convert it using the function :

  Color color=Colors.deepPurple;
  String hex="#000000";
InkWell(
onTap: (){
/// Convert HexColor to Color()
print(hexToColor(hex).toString());
/// Convert Color() to HexColor
print(colorToHex(color).hex);
print(colorToHex(color).color);
},
child:Text("click to convert",style: TextStyle(
/// here we convert the color to hex then we convert the hex to color again
color: color.convertToHex.hex!.convertToColor
),)
)
4
likes
150
pub points
77%
popularity

Publisher

verified publisherabom.me

Flutter package to convert hex String to Color() , and Color() to hex String

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on color_hex