PineForge v0.13.1-379-g9b50973
Deterministic PineScript v6 backtest runtime — C ABI reference
Loading...
Searching...
No Matches
color.hpp
Go to the documentation of this file.
1#pragma once
2#include <cstdint>
3
4namespace pineforge {
5
6namespace pine_color {
7 constexpr int64_t red = 0xFFFF0000;
8 constexpr int64_t green = 0xFF4CAF50;
9 constexpr int64_t blue = 0xFF2196F3;
10 constexpr int64_t white = 0xFFFFFFFF;
11 constexpr int64_t black = 0xFF000000;
12 constexpr int64_t yellow = 0xFFFFEB3B;
13 constexpr int64_t orange = 0xFFFF9800;
14 constexpr int64_t purple = 0xFF9C27B0;
15 constexpr int64_t aqua = 0xFF00BCD4;
16 constexpr int64_t gray = 0xFF787B86;
17 constexpr int64_t lime = 0xFF00E676;
18 constexpr int64_t maroon = 0xFF880E4F;
19 constexpr int64_t navy = 0xFF311B92;
20 constexpr int64_t olive = 0xFF808000;
21 constexpr int64_t silver = 0xFFC0C0C0;
22 constexpr int64_t teal = 0xFF00897B;
23 constexpr int64_t fuchsia = 0xFFE040FB;
24 inline int64_t new_color(int64_t c, int transp) {
25 int alpha = (int)((100 - transp) * 2.55);
26 return (c & 0x00FFFFFF) | ((int64_t)alpha << 24);
27 }
28 inline int r(int64_t c) { return (int)((c >> 16) & 0xFF); }
29 inline int g(int64_t c) { return (int)((c >> 8) & 0xFF); }
30 inline int b(int64_t c) { return (int)(c & 0xFF); }
31 inline int t(int64_t c) { return 100 - (int)((c >> 24) & 0xFF) * 100 / 255; }
32}
33
34} // namespace pineforge
int g(int64_t c)
Definition color.hpp:29
constexpr int64_t yellow
Definition color.hpp:12
constexpr int64_t green
Definition color.hpp:8
int t(int64_t c)
Definition color.hpp:31
constexpr int64_t orange
Definition color.hpp:13
constexpr int64_t teal
Definition color.hpp:22
int b(int64_t c)
Definition color.hpp:30
constexpr int64_t aqua
Definition color.hpp:15
int r(int64_t c)
Definition color.hpp:28
constexpr int64_t red
Definition color.hpp:7
constexpr int64_t lime
Definition color.hpp:17
int64_t new_color(int64_t c, int transp)
Definition color.hpp:24
constexpr int64_t gray
Definition color.hpp:16
constexpr int64_t black
Definition color.hpp:11
constexpr int64_t olive
Definition color.hpp:20
constexpr int64_t blue
Definition color.hpp:9
constexpr int64_t silver
Definition color.hpp:21
constexpr int64_t white
Definition color.hpp:10
constexpr int64_t navy
Definition color.hpp:19
constexpr int64_t purple
Definition color.hpp:14
constexpr int64_t fuchsia
Definition color.hpp:23
constexpr int64_t maroon
Definition color.hpp:18