flutter_color_analyzer 0.1.1 icon indicating copy to clipboard operation
flutter_color_analyzer: ^0.1.1 copied to clipboard

Analyze perceptual differences between colors in order to choose optimal color palettes in an accessible way.

example/README.md

ColorAnalyzer.noticeablyDifferent #

Based on [1] determine if two colors are noticeably different or not. By default use a model that empirically matches results for 50% of observers noticing a different for color patches with a visual angle of 0.1 degrees (around 0.05cm size viewed from 30cm distance).

import 'package:flutter/material.dart';
import 'package:flutter_color_analyzer/big_color.dart';

void main() {
    final lightBlueAccent = BigColor.fromColor(Colors.lightBlueAccent);
    final lightBlue = BigColor.fromColor(Colors.lightBlue);
    final areNoticeablyDifferent = ColorAnalyzer.noticeablyDifferent(lightBlueAccent, lightBlue);

    // areNoticeablyDifferent is false, because based on the model 50% of observers do not
    // notice a different between lightBlueAccent and lightBlue with a visual angle of 0.1
    // degrees
}

References #

  1. Stone, Maureen C., Danielle Albers Szafir and Vidya Setlur. “An Engineering Model for Color Difference as a Function of Size.” (2014).
3
likes
115
pub points
13%
popularity

Publisher

verified publisher iconihsan.io

Analyze perceptual differences between colors in order to choose optimal color palettes in an accessible way.

Repository (GitHub)

Documentation

API reference

License

Icon for licenses.Apache-2.0 (LICENSE)

Dependencies

flutter

More

Packages that depend on flutter_color_analyzer