Skip to main content

getMarketSentiment

Stock Screening Platform - Frontend API v0.1.0


Stock Screening Platform - Frontend API / config/theme / getMarketSentiment

Function: getMarketSentiment()

getMarketSentiment(sentiment): { text: "text-gray-600"; bg: "bg-gray-50"; border: "border-gray-200"; hover: "hover:bg-gray-100"; icon: "➡️"; hex: "#6b7280"; } | { text: "text-emerald-700"; bg: "bg-emerald-100"; border: "border-emerald-300"; icon: "🐂"; hex: "#059669"; } | { text: "text-rose-700"; bg: "bg-rose-100"; border: "border-rose-300"; icon: "🐻"; hex: "#e11d48"; }

Defined in: src/config/theme.ts:176

Sentiment utility function

Get market sentiment color based on sentiment value

Parameters

sentiment

Sentiment indicator (-1 to 1, or categorical string)

number | "neutral" | "bullish" | "bearish"

Returns

{ text: "text-gray-600"; bg: "bg-gray-50"; border: "border-gray-200"; hover: "hover:bg-gray-100"; icon: "➡️"; hex: "#6b7280"; } | { text: "text-emerald-700"; bg: "bg-emerald-100"; border: "border-emerald-300"; icon: "🐂"; hex: "#059669"; } | { text: "text-rose-700"; bg: "bg-rose-100"; border: "border-rose-300"; icon: "🐻"; hex: "#e11d48"; }

Color configuration object

Example

const color = getMarketSentiment(0.7) // bullish
console.log(color.icon) // '🐂'