base
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class ColorHelper {
|
||||
static Color hexToColor(String hex) {
|
||||
hex = hex.replaceAll('#', '').replaceFirst('0x', '');
|
||||
if (hex.length == 6) hex = 'FF$hex'; // Tambah alpha jika belum ada
|
||||
return Color(int.parse('0x$hex'));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user