• Stars
    star
    216
  • Rank 177,357 (Top 4 %)
  • Language
    Dart
  • License
    MIT License
  • Created about 6 years ago
  • Updated about 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A simple but useful package to play with colors in flutter

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)"))),
            ],
          ),
        ));
  }
}

More Repositories

1

gtranslate

Google translate API for unlimited and free translations, gtranslate generates the necessary token to use the Google Translate API for free
Go
208
star
2

blackholeDB

BlackholeDB is a simple distributed key-value DB based on IPFS protocol.
Go
124
star
3

bcidatasetIV2a

This is a repository for BCI Competition 2008 dataset IV 2a fixed and optimized for python and numpy. This dataset is related with motor imagery
Python
109
star
4

eeg_motor_imagery_gan

This repository save my work about GAN applied to motor imagery eeg signals
Jupyter Notebook
38
star
5

PGoJs

Processing sketchs with Go, using p5Js as core
Go
33
star
6

freeproxy

Proxy a la carte, set with different proxies your project
Go
13
star
7

Bookgot

Simple script for farm free books from PackPub.com
Go
9
star
8

culqi-hook

A small hook to integrate Culqi with the most recent react's feature: hooks.
JavaScript
7
star
9

newtabdribbble

Source code of New Tab Dribbble extension
JavaScript
5
star
10

gaea

Life for your user data
Go
5
star
11

freya

Micro service for mailing and SMS with gRPC as communication protocol
Go
4
star
12

torioux-hands

Deep learning application example to apply to Torioux Group
Jupyter Notebook
3
star
13

rengo

Get public Peruvian people data from Reniec, bypass written in Go, based on "peruanosenlinea.com"
Go
3
star
14

homebrew-tilibs

Hoembrew tap with libraries for connecting to Texas Instruments calculators (Fixed some formulae errors)
Ruby
2
star
15

detechApp

App for detech (Ulcers detector using machine learning)
Dart
2
star
16

simple-react-example

Simple react example using styled-components
JavaScript
2
star
17

Vowel_classification

A simple project for Signal Processing course at UTEC University
Jupyter Notebook
2
star
18

opendribbble

A simple scrapper for get popular shots of dribbble website
Go
2
star
19

AutoCalendarUTEC

HTML
2
star
20

whoiam

My personal presentation
Elm
2
star
21

ergo

I have an error "ergo" I handle it
Go
2
star
22

endemica

EndΓ©mica is a Peruvian project to show our endemic plant species to be used by researchers and any person interested in our biodiversity.
Dart
2
star
23

PotatoesOnMarsControl

v2.0
Java
1
star
24

labo

Labo is a CLI tool to perform a research environment
Go
1
star
25

whoiam-pitch

Elevator Pitch about Bregy
JavaScript
1
star
26

lsd

LSD is a simple notification broker delivery
Go
1
star
27

timy

Timy is a tool to record different events and process this insights with machine learning algorithms
Go
1
star
28

graffity

1
star
29

shh-js

JS client to encode message to SHH server
JavaScript
1
star
30

bregyme

My own site for all my work
JavaScript
1
star
31

Echoes

MMOCM
JavaScript
1
star
32

sunat-crawler

Crawler Puppeteer based for get names from dni information, this tool only works into Peru
JavaScript
1
star
33

MarsWeatherSimulator

Java
1
star
34

neuro

Research about Brain Computer Interfaces
JavaScript
1
star
35

baaas

Python
1
star
36

micro-culqi

Micro-culqi is a micro service related to culqi charges and culqi subscriptions
Go
1
star
37

shh

a simple shh for your browser-server trades
Go
1
star
38

prisgo

Prisma Binding with Go! Prima + GQLGen = Full GraphQL Go Server
Go
1
star
39

HUMO

Unofficial API for UTEC EDU system (It works so slow as the original)
Jupyter Notebook
1
star
40

ceres

REST generator with Go, Boltdb and Iris-go
Go
1
star
41

holmes

Holmes is a set of tools to scrapping public information about Peruvian government workers and politicians
Python
1
star
42

Detech_web

This is the second intent creating detech web
HTML
1
star
43

dmt

DMT is a minimalistic multi channel delivery system with a very easy way to execute a task.
Go
1
star