パッケージ、リポジトリ、アプリカテゴリを検索

パッケージ詳細v0.0.1

color_hex

16進数文字列をColor()に、Color()を16進数文字列に変換するFlutterパッケージ

AndroidiOSWebmacOSWindowsLinux
30日間ダウンロード
766
いいね数
6
Pub ポイント
140

パッケージをインストール

flutter pub add color_hex

パッケージ概要

公開情報に基づく選定ガイドです。参考としてご利用ください。

color_hex パッケージは、16進数カラーコードとFlutterのColorオブジェクトの間でスムーズに変換できる軽量なFlutterユーティリティです。'#FF5733'のような16進コードをColorインスタンスに解析し、Colorオブジェクトをその16進数文字列表現に戻すための簡単なメソッドを提供することで、アプリ内のカラーハンドリングを簡素化します。動的なテーマ設定、カラーピッカー、またはテキスト入力からのカラーマニピュレーションが必要なあらゆるシナリオに最適です。

用途

  • 16進数文字列をColorオブジェクトに変換する
  • Color インスタンスから16進数文字列を生成する
  • ダイナミックなテーマカスタマイズ
  • カラーピッカーの統合
  • 16進数値を使用してUI要素をスタイリングする
  • 色の設定を保存および読み込む

主な機能

  • シンプルな16進数からカラーへの変換
  • カラーから16進数文字列へのシリアル化
  • 16進数でのアルファチャンネルをサポート
  • 最小の依存関係フットプリント
  • クロスプラットフォーム互換性
  • 洗練された直感的な API

適している対象

  • カラーテーマを使用している開発者
  • カラーピッカーを使用するアプリ
  • 16進数ベースの色保存を必要とするプロジェクト
  • カラーロジックを実装するUI/UXデザイナー
  • 一貫したカラーハンドリングが必要なFlutterアプリ

注意事項

  • 16進数形式の入力を検証しません
  • 名前付きの色に対する組み込みサポートなし
  • 基本的な色文字列操作に限定
  • 無効な16進数に対する手動エラー処理が必要です
  • 複雑な色の操作には適していません

元の README

関連するソースリポジトリの README 原文のスナップショットです。最新の内容はリポジトリをご覧ください。

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
),)
)

カテゴリー

ソースリポジトリ

このパッケージを使用しているプロジェクト

データはまだありません。