Plugin properties rework.
This commit is contained in:
@@ -23,7 +23,6 @@ import WithStyles from './WithStyles';
|
||||
import {createStyles} from './WithStyles';
|
||||
|
||||
import { withStyles } from "tss-react/mui";
|
||||
import { PiPedalModelFactory } from "./PiPedalModel";
|
||||
import { PluginType } from './Lv2Plugin';
|
||||
|
||||
|
||||
@@ -67,6 +66,7 @@ import FxEmptyIcon from './svg/fx_empty.svg?react';
|
||||
import FxTerminalIcon from './svg/fx_terminal.svg?react';
|
||||
|
||||
import { isDarkMode } from './DarkMode';
|
||||
import { PiPedalModel } from './PiPedalModel';
|
||||
|
||||
export interface IconColorSelect {
|
||||
key: string,
|
||||
@@ -80,21 +80,65 @@ export const getIconColorSelections = (darkMode?: boolean): IconColorSelect[] =>
|
||||
let l: number;
|
||||
let c: number;
|
||||
if (darkMode) {
|
||||
l = 0.8;
|
||||
l = 0.8
|
||||
c = 0.25;
|
||||
} else {
|
||||
l = 0.5;
|
||||
c = 0.25;
|
||||
c = 0.20;
|
||||
}
|
||||
|
||||
for (let angle = 0; angle < 360; angle += 22.5) {
|
||||
result.push(
|
||||
{
|
||||
key: "oklch" + Math.round(angle*10).toString(),
|
||||
value: ("oklch(" + l.toString() + " " + c.toString() + " " + (angle).toString() + ")")
|
||||
|
||||
if (angle === 270-22.5)
|
||||
{
|
||||
// for some reason, this one is useless. Patch in a more useful light blue. :-/
|
||||
let a2 = 270;
|
||||
let l2: number;
|
||||
let c2: number;
|
||||
if (darkMode) {
|
||||
l2 = 0.9
|
||||
c2 = 0.25;
|
||||
} else {
|
||||
l2 = 0.7;
|
||||
c2 = 0.20;
|
||||
}
|
||||
);
|
||||
result.push(
|
||||
{
|
||||
key: "oklch" + Math.round(angle*10).toString(),
|
||||
value: ("oklch(" + l2.toString() + " " + c2.toString() + " " + (a2).toString() + ")")
|
||||
|
||||
}
|
||||
);
|
||||
|
||||
} else if (angle === 270-45)
|
||||
{
|
||||
// for some reason, this one is useless. Patch in a more useful light blue. :-/
|
||||
let a2 = 180;
|
||||
let l2: number;
|
||||
let c2: number;
|
||||
if (darkMode) {
|
||||
l2 = 0.95
|
||||
c2 = 0.25;
|
||||
} else {
|
||||
l2 = 0.75;
|
||||
c2 = 0.20;
|
||||
}
|
||||
result.push(
|
||||
{
|
||||
key: "oklch" + Math.round(angle*10).toString(),
|
||||
value: ("oklch(" + l2.toString() + " " + c2.toString() + " " + (a2).toString() + ")")
|
||||
|
||||
}
|
||||
);
|
||||
|
||||
} else {
|
||||
result.push(
|
||||
{
|
||||
key: "oklch" + Math.round(angle*10).toString(),
|
||||
value: ("oklch(" + l.toString() + " " + c.toString() + " " + (angle).toString() + ")")
|
||||
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
|
||||
@@ -317,7 +361,7 @@ export function SelectBaseIcon(plugin_type: PluginType): string {
|
||||
|
||||
export function SelectIconUri(plugin_type: PluginType) {
|
||||
let icon = SelectBaseIcon(plugin_type);
|
||||
return PiPedalModelFactory.getInstance().svgImgUrl(icon);
|
||||
return PiPedalModel.getInstance().svgImgUrl(icon);
|
||||
}
|
||||
|
||||
const PluginIcon = withStyles((props: PluginIconProps) => {
|
||||
|
||||
Reference in New Issue
Block a user