cleanup: rename text-blending to alpha-blending

+ correct docs
This commit is contained in:
Qwerasd
2025-01-27 19:37:44 -05:00
parent 5c8f984ea1
commit 016a26cf98
2 changed files with 16 additions and 15 deletions

View File

@ -259,7 +259,8 @@ pub const renamed = std.StaticStringMap([]const u8).initComptime(&.{
/// What color space to use when performing alpha blending. /// What color space to use when performing alpha blending.
/// ///
/// This affects how text looks for different background/foreground color pairs. /// This affects the appearance of text and of any images with transparency.
/// Additionally, custom shaders will receive colors in the configured space.
/// ///
/// Valid values: /// Valid values:
/// ///
@ -276,11 +277,7 @@ pub const renamed = std.StaticStringMap([]const u8).initComptime(&.{
/// * `linear-corrected` - Same as `linear`, but with a correction step applied /// * `linear-corrected` - Same as `linear`, but with a correction step applied
/// for text that makes it look nearly or completely identical to `native`, /// for text that makes it look nearly or completely identical to `native`,
/// but without any of the darkening artifacts. /// but without any of the darkening artifacts.
/// @"alpha-blending": AlphaBlending = .native,
/// Note: This setting affects more than just text, images will also be blended
/// in the selected color space, and custom shaders will receive colors in that
/// color space as well.
@"text-blending": TextBlending = .native,
/// All of the configurations behavior adjust various metrics determined by the /// All of the configurations behavior adjust various metrics determined by the
/// font. The values can be integers (1, -1, etc.) or a percentage (20%, -15%, /// font. The values can be integers (1, -1, etc.) or a percentage (20%, -15%,
@ -1220,12 +1217,16 @@ keybind: Keybinds = .{},
/// This is currently only supported on macOS and Linux. /// This is currently only supported on macOS and Linux.
@"window-theme": WindowTheme = .auto, @"window-theme": WindowTheme = .auto,
/// The colorspace to use for the terminal window. The default is `srgb` but /// The color space to use when interpreting terminal colors. "Terminal colors"
/// this can also be set to `display-p3` to use the Display P3 colorspace. /// refers to colors specified in your configuration and colors produced by
/// direct-color SGR sequences.
/// ///
/// Changing this value at runtime will only affect new windows. /// Valid values:
/// ///
/// This setting is only supported on macOS. /// * `srgb` - Interpret colors in the sRGB color space. This is the default.
/// * `display-p3` - Interpret colors in the Display P3 color space.
///
/// This setting is currently only supported on macOS.
@"window-colorspace": WindowColorspace = .srgb, @"window-colorspace": WindowColorspace = .srgb,
/// The initial window size. This size is in terminal grid cells by default. /// The initial window size. This size is in terminal grid cells by default.
@ -5825,13 +5826,13 @@ pub const GraphemeWidthMethod = enum {
unicode, unicode,
}; };
/// See text-blending /// See alpha-blending
pub const TextBlending = enum { pub const AlphaBlending = enum {
native, native,
linear, linear,
@"linear-corrected", @"linear-corrected",
pub fn isLinear(self: TextBlending) bool { pub fn isLinear(self: AlphaBlending) bool {
return switch (self) { return switch (self) {
.native => false, .native => false,
.linear, .@"linear-corrected" => true, .linear, .@"linear-corrected" => true,

View File

@ -391,7 +391,7 @@ pub const DerivedConfig = struct {
links: link.Set, links: link.Set,
vsync: bool, vsync: bool,
colorspace: configpkg.Config.WindowColorspace, colorspace: configpkg.Config.WindowColorspace,
blending: configpkg.Config.TextBlending, blending: configpkg.Config.AlphaBlending,
pub fn init( pub fn init(
alloc_gpa: Allocator, alloc_gpa: Allocator,
@ -463,7 +463,7 @@ pub const DerivedConfig = struct {
.links = links, .links = links,
.vsync = config.@"window-vsync", .vsync = config.@"window-vsync",
.colorspace = config.@"window-colorspace", .colorspace = config.@"window-colorspace",
.blending = config.@"text-blending", .blending = config.@"alpha-blending",
.arena = arena, .arena = arena,
}; };
} }