패키지, 저장소 및 앱 카테고리 검색

패키지 상세v0.0.1

color_hex

16진수 문자열을 Color()로 변환하고, Color()를 16진수 문자열로 변환하는 Flutter 패키지

AndroidiOSWebmacOSWindowsLinux
30일 다운로드
766
좋아요
6
Pub 점수
140

패키지 설치

flutter pub add color_hex

패키지 개요

공개 정보를 바탕으로 생성한 선택 가이드입니다.

color_hex 패키지는 헥사데시멀 색상 문자열과 Flutter의 Color 객체 간에 원활한 변환을 가능하게 하는 경량의 Flutter 유틸리티입니다. '#FF5733'과 같은 헥사 코드를 Color 인스턴스로 파싱하고, Color 객체를 다시 그 헥사 문자열 표현으로 변환하는 간단한 메서드를 제공함으로써 앱 내에서 색상 처리를 단순화합니다. 동적 테마, 컬러 피커 또는 텍스트 입력을 통해 색상을 조작해야 하는 모든 상황에 적합합니다.

사용 사례

  • 16진수 문자열을 Color 객체로 변환하기
  • Color 인스턴스에서 16진수 문자열 생성
  • 다이나믹 테마 사용자 정의
  • 색상 선택기 통합
  • 16진수 값으로 UI 요소 스타일링
  • 색 구성표 저장 및 불러오기

주요 기능

  • 간단한 16진수에서 색상 변환
  • 색상에서 16진수 문자열 직렬화
  • 16진수에서 알파 채널을 지원합니다
  • 최소 종속성 프로필
  • 크로스 플랫폼 호환성
  • 깔끔하고 직관적인 API

적합한 대상

  • 색 테마를 사용하는 개발자
  • 색상 선택기 사용 앱
  • 16진수 기반 색상 저장이 필요한 프로젝트
  • 색상 논리를 구현하는 UI/UX 디자이너
  • 일관된 색상 처리가 필요한 플러터 앱

고려 사항

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

카테고리

소스 저장소

이 패키지를 사용하는 프로젝트

아직 데이터가 없습니다.