mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-05-30 23:58:13 +08:00
@@ -1,22 +1,16 @@
|
|||||||
import 'package:canvas_danmaku/models/danmaku_content_item.dart';
|
import 'dart:ui' show Color;
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
|
import 'package:canvas_danmaku/models/danmaku_content_item.dart'
|
||||||
|
show DanmakuItemType;
|
||||||
|
|
||||||
abstract class DmUtils {
|
abstract class DmUtils {
|
||||||
static Color decimalToColor(int decimalColor) {
|
static Color decimalToColor(int decimalColor) =>
|
||||||
// 16777215 表示白色
|
Color(decimalColor | 0xFF000000);
|
||||||
int red = (decimalColor >> 16) & 0xFF;
|
|
||||||
int green = (decimalColor >> 8) & 0xFF;
|
|
||||||
int blue = decimalColor & 0xFF;
|
|
||||||
|
|
||||||
return Color.fromRGBO(red, green, blue, 1);
|
static DanmakuItemType getPosition(int mode) => switch (mode) {
|
||||||
}
|
|
||||||
|
|
||||||
static DanmakuItemType getPosition(int mode) {
|
|
||||||
return switch (mode) {
|
|
||||||
4 => DanmakuItemType.bottom,
|
4 => DanmakuItemType.bottom,
|
||||||
5 => DanmakuItemType.top,
|
5 => DanmakuItemType.top,
|
||||||
7 => DanmakuItemType.special,
|
7 => DanmakuItemType.special,
|
||||||
_ => DanmakuItemType.scroll,
|
_ => DanmakuItemType.scroll,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user