mirror of
https://github.com/ImranR98/Obtainium.git
synced 2025-08-11 17:40:15 +02:00
Remove redundant generateRandomLightColor()
This commit is contained in:
@@ -1,5 +1,3 @@
|
|||||||
import 'dart:math';
|
|
||||||
|
|
||||||
import 'package:easy_localization/easy_localization.dart';
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:obtainium/components/custom_app_bar.dart';
|
import 'package:obtainium/components/custom_app_bar.dart';
|
||||||
@@ -21,21 +19,6 @@ class SettingsPage extends StatefulWidget {
|
|||||||
State<SettingsPage> createState() => _SettingsPageState();
|
State<SettingsPage> createState() => _SettingsPageState();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Generates a random light color
|
|
||||||
// Courtesy of ChatGPT 😭 (with a bugfix 🥳)
|
|
||||||
Color generateRandomLightColor() {
|
|
||||||
// Create a random number generator
|
|
||||||
final Random random = Random();
|
|
||||||
|
|
||||||
// Generate random hue, saturation, and value values
|
|
||||||
final double hue = random.nextDouble() * 360;
|
|
||||||
final double saturation = 0.5 + random.nextDouble() * 0.5;
|
|
||||||
final double value = 0.9 + random.nextDouble() * 0.1;
|
|
||||||
|
|
||||||
// Create a HSV color with the random values
|
|
||||||
return HSVColor.fromAHSV(1.0, hue, saturation, value).toColor();
|
|
||||||
}
|
|
||||||
|
|
||||||
class _SettingsPageState extends State<SettingsPage> {
|
class _SettingsPageState extends State<SettingsPage> {
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
Reference in New Issue
Block a user