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

패키지 상세v1.0.4

pigment

유용하고 간단한 플러터 색상 핸들러입니다.

AndroidiOSWebmacOSWindowsLinux
30일 다운로드
1.8만
좋아요
20
Pub 점수
110

패키지 설치

flutter pub add pigment

패키지 개요

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

Pigment은 애플리케이션 내에서 색상 처리를 단순화하기 위해 설계된 가볍고 직관적인 Flutter 패키지입니다. 다양한 색상 모델과 형식을 지원하며, 색상 생성, 조작 및 변환을 위한 깔끔한 API를 제공합니다. 큰 라이브러리의 복잡성 없이 색상 로직을 간단하게 관리하고 싶은 개발자에게 이상적입니다. Pigment은 모바일, 웹, 데스크톱을 포함한 모든 주요 플랫폼에 원활하게 통합되어 크로스플랫폼 프로젝트에 매우 유연하게 활용할 수 있습니다.

사용 사례

  • UI 디자인에서의 색상 조작
  • 색상 형식 간 변환
  • 다이나믹 테마 생성
  • 사용자 정의 색상 팔레트
  • 앱에서 색상 논리 간소화
  • 반응형 색상 조정

주요 기능

  • 색상 생성 및 분석이 쉬움
  • 다중 색상 모델(HSL, HSV 등) 지원
  • 내장된 색상 혼합 및 불투명도 처리
  • 크로스 플랫폼 호환성
  • 최소한의 보일러플레이트
  • 확장 가능한 색상 작업

적합한 대상

  • 간단한 색상 유틸리티가 필요한 플러터 개발자
  • 동적 또는 테마 기반 색상 스키마를 가진 앱
  • 디자이너와 개발자가 UI 색상 시스템에서 협업하고 있습니다
  • 일관된 색상 관리가 필요한 프로젝트
  • 프로토타이핑 및 빠른 UI 개발

고려 사항

  • 고급 색채 이론 응용을 위한 것이 아님
  • 기본 색상 작업에 제한됨
  • 내장된 색상 선택기 UI 없음
  • 간단한 색상 처리 요구 사항에 가장 적합
  • 기능이 풍부한 컬러 피커를 대체하지 않습니다

원본 README

연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.

Pigment

pub package

A simple but useful plugin for use colors with Flutter

Features

  • You can use string colors (like #01E19F) direct in flutter
  • Pigment extends to Color dar:ui class, then you can use all methods of Color class
  • Pigment 1.0.1 can parse 'rgb()' (e.g. 'rgb(29, 123, 10)').
  • Added CSS colors with default name, you can access from this with CSSColor.* (e.g. Pigment.fromCSSColor(CSSColor.lightsalmon)) or directly with Pigment.fromString('lightsalmon').

Installation

First, add pigment as a dependency in your pubspec.yaml file.

Use

It's very simple, pigment add a new useful method to Color class, this method is Pigment.fromString(). Also like Color, you can use new Pigment().

Pigment.fromString()
new Pigment()

Example

Here is a small example of the classic and simple pigment use.

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

void main() => runApp(new MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return new MaterialApp(
      title: 'Pigment Demo',
      theme: new ThemeData(
        primarySwatch: Colors.red,
      ),
      home: new MyHomePage(),
    );
  }
}

class MyHomePage extends StatefulWidget {
  @override
  _MyHomePageState createState() => new _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    return new Scaffold(
        appBar: new AppBar(
          title: new Text('Pigment App'),
        ),
        body: new Center(
          child: new Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: <Widget>[
              new Text('Pigment is cool',
                  style: new TextStyle(color: Pigment.fromString("#FE5567"))),
              new Text('Pigment is cool',
                  style: new TextStyle(color: Pigment.fromString("#01E19F"))),
              new Text('Pigment is cool',
                  style: new TextStyle(color: Pigment.fromString("#4A48D2"))),
              new Text('Pigment is cool',
                  style: new TextStyle(color: Pigment.fromString("rgb(253, 196, 86)"))),
            ],
          ),
        ));
  }
}

카테고리

소스 저장소

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