1
1
mirror of https://github.com/wez/wezterm.git synced 2024-09-11 14:25:57 +03:00
Commit Graph

30 Commits

Author SHA1 Message Date
Wez Furlong
1d4d6df045
color-types: prep for crates.io publish 2024-01-27 12:16:47 -07:00
Wez Furlong
f472a5abfb
wezterm-dynamic: bump version of crates.io publish
Not sure if it is strictly necessary to do this, but stuff
has changed since the last publish.
2024-01-27 12:09:16 -07:00
Wez Furlong
c607c6a59c
allow rgba for all window_frame colors
refs: https://github.com/wez/wezterm/issues/3580
2024-01-20 10:06:02 -07:00
Wez Furlong
7af61159a8
font: port over radial gradient fills 2023-08-22 06:43:58 -07:00
Wez Furlong
1ed4058741
fonts: add freetype COLR 1 raster impl
This isn't fully baked, but it looks mostly ok.
The ghost emoji has a weirdly positioned white patch; there's
something funky with its positioning that needs to be investigated.

There's some copypasta here; a bunch of the cairo related stuff
was copied and adapted from the harfbuzz impl.

I plan to refactor the latter in terms of the former to reduce
the amount of code overall.
2023-08-20 15:19:30 -07:00
Jalil David Salamé Messina
b32863cc2f fix(clippy): Implement From instead of Into
Implementing `From` is prefered as this also implements the `Into` trait, may
not be desireable for code size/compilation time reasons.
2023-04-03 08:31:12 -07:00
Wez Furlong
00943345b6
make Vertex conform to Pod 2022-11-18 10:03:49 -07:00
Wez Furlong
30daed40b3
reduce size of BoxedQuad by 2/3
Since we're no longer tied to contiguous Vertex slices, we can
record the Quad data used for HeapQuadAllocator in a smaller structure,
so that's what this does.

It reduces the per-Quad storage from 272 bytes down to 84 bytes,
which helps with overall memory usage: the default cache size is 1024
lines worth of quads, so this can add up to multiple MB of RAM.

refs:  https://github.com/wez/wezterm/issues/2626
2022-11-14 23:11:02 -07:00
Wez Furlong
1c8a20d577
gui: fix cursor color invalidation issue
Things like compose cursor and dynamically changed cursor colors
were not factored into our cache keys, making the cursor color
"sticky" in the wrong ways.

refs: https://github.com/wez/wezterm/issues/2708

Might possibly also help with https://github.com/wez/wezterm/issues/2635
2022-11-13 16:47:34 -07:00
Wez Furlong
673ca3ad07 color types version bump for crates.io 2022-08-01 18:41:52 -07:00
Wez Furlong
bc083ee470 termwiz: ColorSpec now allows for alpha to be tracked
This doesn't really change any behavior, but adjusts the types
such that CSIs that set colors have the potential to track the
alpha channel and that can make it through to the GUI/render layer.
2022-07-26 19:39:53 -07:00
Wez Furlong
cb89f2c36e allow setting alpha for OSC 10, 11, 12
refs: https://github.com/wez/wezterm/issues/2313
2022-07-26 19:02:47 -07:00
Wez Furlong
c81dabd76b rustfmt 2022-07-17 21:55:39 -07:00
Wez Furlong
1c32ac95bf cargo update
and address deprecation warnings for csscolorparser
2022-07-17 21:14:47 -07:00
Wez Furlong
810512c2c5 colors: refine importer
Adjust importer to read directly from the source .itermcolors
files in the upstream repo.  Extract some author information
from the comments in those files.

All data is now fetched (and cached!) via relatively minimal
http requests rather than requiring a git repo locally.

Also search for .yml files in base16 repos; found another
couple of schemes this way.

The toml files under assets/colors are no longer read by
anything in the repo. I plan to remove them, but since the
docs reference them as examples, I will first ensure that
there are docs and tooling that explains how to write and
share your own scheme files.
2022-07-14 00:14:16 -07:00
Wez Furlong
aa697c72ba color: refactor docs, add a couple more methods
Moved the gradient function into the color module, but kept an alias
under the old name.

Gradients now return color objects.

Converting colors to string now uses rgba format when alpha is not 100%.
2022-07-12 07:45:08 -07:00
Wez Furlong
98fb67c029 fix termwiz build 2022-07-11 21:20:31 -07:00
Wez Furlong
c8ca2054f6 lua: add wezterm.color.extract_colors_from_image
This function can be used to extra distinct colors from
an image to be fed into eg: color scheme generation.
2022-07-11 17:46:36 -07:00
Wez Furlong
cfd9c0b364 colors: add RYB based complement
Now you can complement_ryb yellow to arrive at a purple color,
just like you were taught in art class.
2022-07-11 00:18:39 -07:00
Wez Furlong
463ca2fa29 add wezterm.color module for working with colors
wezterm.color.parse() returns a color object that can be assigned in the
wezterm color config, and that can be used to adjust hue, saturation and
lightness, as well as calculate harmonizing colors (complements, triads,
squares) from the RGB/HSL color wheel.
2022-07-10 23:41:18 -07:00
Davide Cavalca
2dbdfbf124 color-types: add missing license file 2022-07-10 15:48:42 -07:00
Wez Furlong
75066cb522 deps: update
Main thing to note here is that the open crate has deprecated
open::that_in_background, but made open::that non-blocking.

I think this is OK, but I'm a little cagey about what will
happen with this on Windows.  We may need to spawn our own
thread for this if things go awry.
2022-06-12 20:17:48 -07:00
Wez Furlong
e85258a212 background: allow specifying a solid color layer
The color can have alpha and blend with other layers.
This is helpful if your image has fully transparent portions
and you want to explicitly place a color in there.
2022-05-31 08:47:28 -07:00
Wez Furlong
a22942aa13 fixup a couple more cases found by fuzzing
Also ensure the rust backtrace is printed by the fuzzer
for some reason, cargo-fuzz doesn't do this automatically, which limits
its out-of-the-box utility.

refs: https://github.com/wez/wezterm/pull/1986
2022-05-14 08:46:37 -07:00
Wez Furlong
5914a91490 palette now stores alpha for all color values
We're now capable of remembering an alpha value for everything
in the palette and the main window theme, but not the tab bar theme.

Whether the alpha is correctly respected at render time is a different
story!

refs: #1835
2022-04-08 07:08:33 -07:00
Wez Furlong
75e785e01e allow using CSS style color specs in the config
This change also allows removing the dep on the palette crate,
which I found to be difficult to use (API changed often, and relied
on a lot of `.into` that was hard to follow and reconcile across
upgrades).  We already pulled in the csscolorparse crate as an indirect
dep of colorgrad, so we can replace the color conversion we need for
sixel with that crate while we're in here.

refs: #1615
2022-02-06 08:23:26 -07:00
Wez Furlong
8cb74c62d2 allow setting selection colors with alpha values
This commit allows the following configuration:

```
wezterm -n --config 'colors = { selection_fg = "clear", selection_bg = "rgba:50% 50% 50% 50%" }'
```

which sets the selection_bg to fully transparent, and selection_bg to
50% transparent gray.

When selection_fg is fully transparent we'll use the normal fg color.

When selection_bg is partially (or fully!) transparent, it will be
alpha blended over the current cell background color.

To support this, the config file will now accept rgba colors specified
as 4 whitespace delimited numeric values. If a value ends with `%` it
is interpreted as a number in the range 0-100.  Otherwise, it is
interpreted as a number in the range 0-255.  The 4 values are
red, green, blue, alpha.

At this time, only the selection_fg and selection_bg settings accept
alpha values.

refs: #1615
2022-02-05 15:17:22 -07:00
Wez Furlong
240026de48 refactor: move color parsing into wezerm-color-types crate
Resolves a little bit of the awkward duplication of color types
between some of the crates by factoring them a little bit better.

This is prep for allowing specifying alpha for some colors
in the config.
2022-02-05 13:59:54 -07:00
Wez Furlong
725572de9c reduce to a single draw call
Taking further advantage of dynamic quad allocation, we can now
remove the multiple render passes in favor of allocating the quads
and painting them from back to front.

In turn, this means that we can reduce the amount of data that we
store in the vertex, which simplifies the shaders a bit, at the
expense of making the render code in rust a bit more complex.

However, we can take advantage of stretching runs of cells with
background colors in to a single quad.

refs: #986
2021-07-31 00:23:16 -07:00
Wez Furlong
e69869efa7 refactor deps so that window can depend on wezterm-font
I want to use this to render the font in the title bar
2021-06-26 22:58:42 -07:00