Files
PiliPlus/lib/utils/danmaku.dart
bggRGjQaUbCoE fee1ad56f7 feat: use canvas_danmaku
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
2024-12-15 13:25:36 +08:00

26 lines
708 B
Dart

import 'package:canvas_danmaku/models/danmaku_content_item.dart';
import 'package:flutter/material.dart';
class DmUtils {
static Color decimalToColor(int decimalColor) {
// 16777215 表示白色
int red = (decimalColor >> 16) & 0xFF;
int green = (decimalColor >> 8) & 0xFF;
int blue = decimalColor & 0xFF;
return Color.fromARGB(255, red, green, blue);
}
static DanmakuItemType getPosition(int mode) {
DanmakuItemType type = DanmakuItemType.scroll;
if (mode >= 1 && mode <= 3) {
type = DanmakuItemType.scroll;
} else if (mode == 4) {
type = DanmakuItemType.bottom;
} else if (mode == 5) {
type = DanmakuItemType.top;
}
return type;
}
}