Skip to content

Commit

Permalink
color [nfc]: Use library prefix for flutter_color_models import
Browse files Browse the repository at this point in the history
`ColorSpace`, which we'd like to use soon, is a conflicting
identifier between this and dart:ui. Give this one the prefix.
  • Loading branch information
chrisbobbe authored and gnprice committed Sep 7, 2024
1 parent 2046667 commit e1fd43c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/widgets/color.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'dart:ui';

import 'package:flutter_color_models/flutter_color_models.dart';
import 'package:flutter_color_models/flutter_color_models.dart' as flutter_color_models;

// This function promises to deal with "LCH" lightness, not "LAB" lightness,
// but it's not yet true. We haven't found a Dart libary that can work with LCH:
Expand All @@ -11,7 +11,7 @@ import 'package:flutter_color_models/flutter_color_models.dart';
//
// TODO try LCH; see linked discussion
Color clampLchLightness(Color color, num lowerLimit, num upperLimit) {
final asLab = LabColor.fromColor(color);
final asLab = flutter_color_models.LabColor.fromColor(color);
return asLab
.copyWith(lightness: asLab.lightness.clamp(lowerLimit, upperLimit))
.toColor();
Expand Down

0 comments on commit e1fd43c

Please sign in to comment.