Skip to content

Commit

Permalink
steal some color conversions from GtkObservables
Browse files Browse the repository at this point in the history
I think these belong in Gtk4
  • Loading branch information
jwahlstrand committed Sep 16, 2023
1 parent 2bdc21f commit a85094f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ BitFlags = "d1d4a3ce-64b1-5f1a-9ba4-7e7e69966f35"
CEnum = "fa961155-64e5-5f13-b03f-caf6b980ea82"
Cairo = "159f3aea-2a34-519c-b102-8c37f9878175"
Cairo_jll = "83423d85-b0ee-5818-9007-b63ccbeb887a"
ColorTypes = "3da002f7-5984-5a60-b8a6-cbb66c0b333f"
GTK4_jll = "6ebb71f1-8434-552f-b6b1-dc18babcca63"
Glib_jll = "7746bdde-850d-59dc-9ae8-88ece973131d"
Graphene_jll = "75302f13-0b7e-5bab-a6d1-23fa92e4c2ea"
Expand All @@ -28,6 +29,7 @@ BitFlags = "0.1.5"
CEnum = "0.4.2"
Cairo = "1.0.0"
Cairo_jll = "1.16.0"
ColorTypes = "0.10, 0.11"
GTK4_jll = "4.6.0"
Glib_jll = "2.74.0"
Graphene_jll = "1.10"
Expand Down
3 changes: 3 additions & 0 deletions src/Gdk4.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ function GdkRGBA(rgba::AbstractString)
r
end

convert(::Type{RGBA}, gcolor::Gtk4.GdkRGBA) = RGBA(gcolor.red, gcolor.green, gcolor.blue, gcolor.alpha)
convert(::Type{Gtk4.GdkRGBA}, color::Colorant) = Gtk4.GdkRGBA(red(color), green(color), blue(color), alpha(color))

## GdkCursor

GdkCursor(name::AbstractString; kwargs...) = GdkCursor(name, nothing; kwargs...)
Expand Down
1 change: 1 addition & 0 deletions src/Gtk4.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ end

import CEnum: @cenum
import BitFlags: @bitflag
import ColorTypes: Colorant, RGBA

include("GLib/GLib.jl")
include("Pango/Pango.jl")
Expand Down

0 comments on commit a85094f

Please sign in to comment.