fluffychat/lib/utils/color_value.dart
ggurdin 9ecf4e3bd2
fix: fix dart formatting for CI (#1368)
* fix: fix dart formatting for CI

* fix: sorted imports, updated deprecated flutter functions

* fix: format files

* fix: format files

* feat: replace syncfusion flutter package with excel flutter package

* fix: don't run enable google services patch in CI

* fix: update iOS supported platforms for enable ios build script

* fix: commented out linux build in integrate CI
2025-01-07 08:32:42 -05:00

14 lines
309 B
Dart

import 'package:flutter/widgets.dart';
extension ColorValue on Color {
int get hexValue {
return _floatToInt8(a) << 24 |
_floatToInt8(r) << 16 |
_floatToInt8(g) << 8 |
_floatToInt8(b) << 0;
}
static int _floatToInt8(double x) {
return (x * 255.0).round() & 0xff;
}
}