Commit Graph

80461 Commits

Author SHA1 Message Date
Matthias Clasen
76caf2c812 color value: Organize the code
Add some sections, so I can find my way around.
2024-06-02 08:46:56 -04:00
Matthias Clasen
3d5fce1b9f Fix a bug in color conversion
The linear space corresponding to oklab is oklab, not srgb-linear.
2024-06-02 08:46:33 -04:00
Matthias Clasen
bfe8adbee4 Merge branch 'fix-obvious-doc-issues' into 'main'
Fix obvious docstring issues

See merge request GNOME/gtk!7320
2024-06-02 12:02:06 +00:00
Matthias Clasen
827642303c Merge branch 'fix-getter-for-dropdown' into 'main'
gtkdropdown: Use proper attribute

See merge request GNOME/gtk!7327
2024-06-02 11:56:53 +00:00
Maximiliano Sandoval
6b6a0e1257
docs: Fix {g,s}et_property attributes annotations
Do not use set_property on getters and vice versa.
2024-06-02 13:49:45 +02:00
Martin
7a98176a02 Update Slovenian translation 2024-06-01 08:53:47 +00:00
Maximiliano Sandoval
bf42351ebf
cellrendererspinner: Fix active signal docs 2024-06-01 09:04:01 +02:00
Maximiliano Sandoval
ee277f4d92
gtksectionmodel: Fix typo in sections-changed link 2024-06-01 09:04:01 +02:00
Maximiliano Sandoval
00acc7957f
gdkcursor: Fix typo in GdkCursorGetTestureCallback 2024-06-01 09:04:00 +02:00
Maximiliano Sandoval
a931335f24
gskglshader: Correct typo in source property 2024-06-01 09:04:00 +02:00
Maximiliano Sandoval
1ef320a9ec
gsktransform: Document constructor 2024-06-01 09:04:00 +02:00
Maximiliano Sandoval
411b7f12b5
gtkicontheme: Fix typo in return annotation 2024-06-01 09:03:59 +02:00
Maximiliano Sandoval
611fcfb1c7
gtkgraphicsoffload: Fix typo in prop name 2024-06-01 09:03:59 +02:00
Maximiliano Sandoval
6257a51f4f
gtkflowbox: Fix typos in annotations 2024-06-01 09:03:58 +02:00
Maximiliano Sandoval
e24630bd18
gtkenums: Correctly document AnnouncementPriority 2024-06-01 09:03:58 +02:00
Maximiliano Sandoval
6b0b3a4db7
gtkprintsettings: Delete extra whitespace 2024-06-01 09:03:58 +02:00
Maximiliano Sandoval
fd19c7c2ab
gtkscrolledwindow: Fix typo in docstring 2024-06-01 09:03:57 +02:00
Maximiliano Sandoval
4aa2206699
gtktextview: Fix typo Textview in docstrings 2024-06-01 09:03:57 +02:00
Maximiliano Sandoval
eae23ebf69
gtkbuilderscope: Correct the argument values
These should match the function arguments.
2024-06-01 09:03:56 +02:00
Maximiliano Sandoval
ecd27f6c3c
entry: Fix typos in tabs and show-emoji-icon 2024-06-01 09:03:56 +02:00
Maximiliano Sandoval
01f3c72338
sectionsmodel: Fix typo in docstring 2024-06-01 09:03:55 +02:00
Matthias Clasen
87be414c05 Merge branch 'color-fixes' into 'main'
Fix oklch conversion

See merge request GNOME/gtk!7324
2024-06-01 01:42:45 +00:00
Matthias Clasen
f6d676cc8a inspector: Use gdk_rgba_print when suitable 2024-05-31 21:39:32 -04:00
Matthias Clasen
4961241f26 gsk: Use gdk_rgba_print when suitable 2024-05-31 21:39:04 -04:00
Matthias Clasen
60c944bb94 Add tests for color conversion and interpolation
Add some tests for gtk_css_color_convert and
gtk_css_color_interpolate, mostly based on examples
in the spec.
2024-05-31 21:29:49 -04:00
Matthias Clasen
740c10282f Add gtk_css_color_print and gtk_css_color_to_string
These are useful for testing and debugging.
2024-05-31 21:29:49 -04:00
Matthias Clasen
3a4c69f370 gdk: Add gdk_rgba_print 2024-05-31 21:29:49 -04:00
Matthias Clasen
c3083572fb css: Small api fix
This should have been const.
2024-05-31 21:29:49 -04:00
Matthias Clasen
8ecb00be66 css: Export some color value api for tests
Export enough api to test color conversion and interpolation.
2024-05-31 21:29:49 -04:00
Matthias Clasen
48e707aceb css: Color interpolation fixes
Some minor gotchas and oversights.
2024-05-31 21:29:49 -04:00
Matthias Clasen
e2f9ff2304 Fix oklch conversion
The pseudo-code in the spec is broken.
2024-05-31 21:27:22 -04:00
Matthias Clasen
fa3a72c8f6 Fix oklch conversion
We want to normalize angles to be in [0, 360).
2024-05-31 21:25:54 -04:00
Matthias Clasen
fc45d90834 css: Fix oklab parsing 2024-05-31 19:33:56 -04:00
Matthias Clasen
fcd95cd5c6 css: Fix oklab conversion 2024-05-31 19:33:22 -04:00
Matthias Clasen
b8c1ac41d2 Merge branch 'css-color-missing-components' into 'main'
css: Add GtkCssColor

See merge request GNOME/gtk!7323
2024-05-31 21:05:24 +00:00
Matthias Clasen
90e1ce0906 Merge branch 'new-docstrings' into 'main'
Add missing docstrings

See merge request GNOME/gtk!7321
2024-05-31 19:57:53 +00:00
Matthias Clasen
d121fd5b7d css: Tweak compute for color values
Make color values carry their srgb equivalent and don't turn them
into literals at compute time. This is necessary so we can use their
original color space values in interpolation.

This makes color values a bit larger, but they still fit into one
cacheline.

We don't change handling of named colors and our color expressions.
They still get turned into literal colors.
2024-05-31 15:51:02 -04:00
Matthias Clasen
4d88fcc1db css: Use gtk_css_color_convert
Use gtk_css_color_convert for going to srgb and stop relying on
GdkRGBA for printing.
2024-05-31 15:51:02 -04:00
Matthias Clasen
85fcda178e css: Implement color interpolation
Implement gtk_css_color_convert, which is an attempt to implement
most of https://www.w3.org/TR/css-color-4/#interpolation for the
color spaces we support.
2024-05-31 15:51:02 -04:00
Matthias Clasen
ecc678454b css: Implement color conversion
Implement gtk_css_color_convert, which is an attempt to
implement https://www.w3.org/TR/css-color-4/#color-conversion
for the color spaces we support.

Missing:
- white point adaptation
- gamut mapping
2024-05-31 15:51:02 -04:00
Matthias Clasen
5a85bc691e css: Split off GtkCssColor
Break out a GtkCssColor struct.
2024-05-31 15:51:02 -04:00
Matthias Clasen
d506a5eea8 colorutils: Add some more utils
Add oklab<>srgb-linear and rgb<>hls conversions.
2024-05-31 15:51:02 -04:00
Matthias Clasen
aefa79413b css: Implement missing components in colors
Add support for parsing none for color components, and preserve
that information for serialization. We currently don't use it
for other things, but we should.
2024-05-31 15:51:02 -04:00
Matthias Clasen
73e4eb7552 css: gtk_css_color_value_new_literal static too
This function is only used inside gtkcsscolorvalue.c as well.
2024-05-31 15:50:43 -04:00
Matthias Clasen
dff340530a Merge branch 'matthiasc/for-main' into 'main'
css: Make some color value functions static

See merge request GNOME/gtk!7319
2024-05-31 16:40:33 +00:00
Matthias Clasen
f6ea3e1684 inspector: Make css deprecations opt-in
Add a button to show deprecation warnings (since those will
unfortunately be common for while, due to backwards compat).
2024-05-31 11:25:11 -04:00
Matthias Clasen
f790441505 colorutils: Add some more utils
Add oklab<>srgb-linear and hsl<>rgb conversions.
2024-05-31 10:13:35 -04:00
Matthias Clasen
0c307f7563 css: Make some color value functions static
These aren't used outside of gtkcsscolorvalue.c, so don't export
them.
2024-05-31 10:13:35 -04:00
Matthias Clasen
f89dc9644c Cosmetics 2024-05-31 10:12:28 -04:00
Matthias Clasen
735455b523 Merge branch 'memoryfix' into 'main'
Changes to fix the memorytexture regression

Closes #6260

See merge request GNOME/gtk!7111
2024-05-31 10:35:39 +00:00