HT_ThemeTokens

firegenie · library · 41 行 · 点赞 0 · TradingView 原页

本页源码来自 TradingView 公开发布的开源脚本,版权归原作者所有, 请遵循其原始许可(Pine 脚本常见 CC BY-NC-SA / MPL-2.0 / MIT)。 本项目仅用于研究检索与许可范围内的移植。

Pine Script

// This Pine Script® code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © firegenie
 
//@version=6
 
// @description TODO: add library description here
library("HT_ThemeTokens", overlay = true)
 
// 🎨 Theme Colours
export const color colBull     = #76b395
export const color colBullS    = #45a567
export const color colBear     = #b48484
export const color colBearS    = #ad5858
export const color colNeutral  = #748797
 
export const color colAsia     = #51A3A3
export const color colLdn      = #75485E
export const color colNy       = #CB904D
 
export const color colAccent   = #EAB308
export const color txtAccent   = #292c31
export const color colMuted    = #4c4e53
export const color txtMuted    = #d1dbf4
 
export const int lineThin      = 1
export const int lineThick     = 2
 
export const color txtColor    = color.white
export const color hdrBg       = color.new(color.black, 0)
 
// 🎯 Bias score to color mapping helper
// @function Maps bias score to corresponding theme color
// @param code Bias code as integer: +2 (Strong Bullish), +1 (Bullish), 0 (Neutral), -1 (Bearish), -2 (Strong Bearish)
// @returns Color value from the theme palette corresponding to the bias score
export bias_color(int code) =>
    switch code
        2  => colBullS
        1  => colBull
        -1 => colBear
        -2 => colBearS
        => colNeutral

← 返回列表