mirror of
https://github.com/unanmed/HumanBreak.git
synced 2026-10-31 23:20:18 +08:00
修复十六进制颜色不兼容的bug
This commit is contained in:
1 parent
d4c03cdaec
commit
6ecf201beb
4 files changed
+13
-9
No files matched your search
@@ -12,6 +12,7 @@ import {
|
||||
setLightList,
|
||||
setShadowNodes
|
||||
} from './shadow';
|
||||
import { pColor } from '../utils';
|
||||
|
||||
export default function init() {
|
||||
const origin4 = control.prototype.drawHero;
|
||||
@@ -39,7 +40,7 @@ const shadowInfo: Partial<Record<FloorIds, Light[]>> = {
|
||||
y: 144,
|
||||
decay: 20,
|
||||
r: 150,
|
||||
color: '#e953',
|
||||
color: pColor('#e953'),
|
||||
noShelter: true
|
||||
},
|
||||
{
|
||||
@@ -48,7 +49,7 @@ const shadowInfo: Partial<Record<FloorIds, Light[]>> = {
|
||||
y: 144,
|
||||
decay: 20,
|
||||
r: 150,
|
||||
color: '#e953',
|
||||
color: pColor('#e953'),
|
||||
noShelter: true
|
||||
},
|
||||
{
|
||||
@@ -57,7 +58,7 @@ const shadowInfo: Partial<Record<FloorIds, Light[]>> = {
|
||||
y: 336,
|
||||
decay: 20,
|
||||
r: 150,
|
||||
color: '#e953',
|
||||
color: pColor('#e953'),
|
||||
noShelter: true
|
||||
},
|
||||
{
|
||||
@@ -66,13 +67,13 @@ const shadowInfo: Partial<Record<FloorIds, Light[]>> = {
|
||||
y: 336,
|
||||
decay: 20,
|
||||
r: 150,
|
||||
color: '#e953',
|
||||
color: pColor('#e953'),
|
||||
noShelter: true
|
||||
}
|
||||
]
|
||||
};
|
||||
const backgroundInfo: Partial<Record<FloorIds, Color>> = {
|
||||
MT50: '#0006'
|
||||
MT50: pColor('#0006')
|
||||
};
|
||||
const blurInfo: Partial<Record<FloorIds, number>> = {};
|
||||
const immersionInfo: Partial<Record<FloorIds, number>> = {};
|
||||
@@ -86,7 +87,7 @@ export function updateShadow(nocache: boolean = false) {
|
||||
if (!shadowInfo[floor] || !backgroundInfo[floor]) {
|
||||
removeAllLights();
|
||||
setShadowNodes([]);
|
||||
setBackground('#0000');
|
||||
setBackground('transparent');
|
||||
return;
|
||||
}
|
||||
const f = core.status.thisMap;
|
||||
|
||||
@@ -6,6 +6,7 @@ import { ComputedRef, ref } from 'vue';
|
||||
import { EVENT_KEY_CODE_MAP } from './keyCodes';
|
||||
import axios from 'axios';
|
||||
import { decompressFromBase64 } from 'lz-string';
|
||||
import { parseColor } from './webgl/utils';
|
||||
|
||||
type CanParseCss = keyof {
|
||||
[P in keyof CSSStyleDeclaration as CSSStyleDeclaration[P] extends string
|
||||
@@ -258,3 +259,7 @@ export function ensureArray<T>(arr: T): T extends any[] ? T : T[] {
|
||||
// @ts-ignore
|
||||
return arr instanceof Array ? arr : [arr];
|
||||
}
|
||||
|
||||
export function pColor(color: string) {
|
||||
return core.arrayToRGBA(parseColor(color));
|
||||
}
|
||||
Reference in new issue
Block a user