mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-05-27 07:18:22 +00:00
terminal: unify palette functionality into shared type DynamicPalette
This commit is contained in:
@@ -130,7 +130,7 @@ pub const Cell = struct {
|
||||
switch (self.style.fg_color) {
|
||||
.none => cimgui.c.igText("default"),
|
||||
.palette => |idx| {
|
||||
const rgb = t.color_palette.colors[idx];
|
||||
const rgb = t.colors.palette.current[idx];
|
||||
cimgui.c.igValue_Int("Palette", idx);
|
||||
var color: [3]f32 = .{
|
||||
@as(f32, @floatFromInt(rgb.r)) / 255,
|
||||
@@ -169,7 +169,7 @@ pub const Cell = struct {
|
||||
switch (self.style.bg_color) {
|
||||
.none => cimgui.c.igText("default"),
|
||||
.palette => |idx| {
|
||||
const rgb = t.color_palette.colors[idx];
|
||||
const rgb = t.colors.palette.current[idx];
|
||||
cimgui.c.igValue_Int("Palette", idx);
|
||||
var color: [3]f32 = .{
|
||||
@as(f32, @floatFromInt(rgb.r)) / 255,
|
||||
|
||||
@@ -51,7 +51,7 @@ pub fn renderInTable(
|
||||
switch (cursor.style.fg_color) {
|
||||
.none => cimgui.c.igText("default"),
|
||||
.palette => |idx| {
|
||||
const rgb = t.color_palette.colors[idx];
|
||||
const rgb = t.colors.palette.current[idx];
|
||||
cimgui.c.igValue_Int("Palette", idx);
|
||||
var color: [3]f32 = .{
|
||||
@as(f32, @floatFromInt(rgb.r)) / 255,
|
||||
@@ -90,7 +90,7 @@ pub fn renderInTable(
|
||||
switch (cursor.style.bg_color) {
|
||||
.none => cimgui.c.igText("default"),
|
||||
.palette => |idx| {
|
||||
const rgb = t.color_palette.colors[idx];
|
||||
const rgb = t.colors.palette.current[idx];
|
||||
cimgui.c.igValue_Int("Palette", idx);
|
||||
var color: [3]f32 = .{
|
||||
@as(f32, @floatFromInt(rgb.r)) / 255,
|
||||
|
||||
Reference in New Issue
Block a user