global: cost basis -> urpd

This commit is contained in:
nym21
2026-04-22 22:23:52 +02:00
parent 84e924b77e
commit 3faa989691
30 changed files with 950 additions and 507 deletions

View File

@@ -58,7 +58,7 @@ export function init() {
title: "Price",
series: spot.sats,
ohlcSeries: ohlc.sats,
colors: /** @type {const} */ ([colors.bi.p1[1], colors.bi.p1[0]]),
colors: /** @type {const} */ ([colors.default, colors.background]),
}),
...(optionTop.get(Unit.sats) ?? []),
]);

View File

@@ -840,13 +840,13 @@ export function createChart({ parent, brk, fitContent }) {
defaultActive,
options,
}) {
const upColor = customColors?.[0] ?? colors.bi.p1[0];
const downColor = customColors?.[1] ?? colors.bi.p1[1];
const upColor = customColors?.[0] ?? colors.background;
const downColor = customColors?.[1] ?? colors.default;
const candlestickISeries = /** @type {CandlestickISeries} */ (
ichart.addSeries(
/** @type {SeriesDefinition<'Candlestick'>} */ (CandlestickSeries),
{ visible: false, borderVisible: false, ...options },
{ visible: false, borderVisible: true, ...options },
paneIndex,
)
);
@@ -889,10 +889,13 @@ export function createChart({ parent, brk, fitContent }) {
candlestickISeries.applyOptions({
visible: active && !showLine,
lastValueVisible: highlighted,
priceLineColor: colors.default.highlight(highlighted),
upColor: upColor.highlight(highlighted),
downColor: downColor.highlight(highlighted),
wickUpColor: upColor.highlight(highlighted),
wickDownColor: downColor.highlight(highlighted),
wickUpColor: colors.default.highlight(highlighted),
wickDownColor: colors.default.highlight(highlighted),
borderUpColor: colors.default.highlight(highlighted),
borderDownColor: colors.default.highlight(highlighted),
});
lineISeries.applyOptions({
visible: active && showLine,

View File

@@ -125,6 +125,7 @@ function seq(keys) {
export const colors = {
transparent: createColor(() => "transparent"),
default: createColor(() => getLightDarkValue("--color")),
background: createColor(() => getLightDarkValue("--background-color")),
gray: createColor(() => getColor("gray")),
border: createColor(() => getLightDarkValue("--border-color")),
offBorder: createColor(() => getLightDarkValue("--off-border-color")),