Skip to content

termonad colors should be AlphaColour #112

@cdepillabout

Description

@cdepillabout

Termonad is using the colour library to define things like cursor colors, terminal background colors, etc.

In particular, Termonad is using the Colour type.

These Colour types are converted to an RGBA from gi-gdk in the following function:

colourToRgba :: Colour Double -> IO RGBA
colourToRgba colour = do
let RGB red green blue = toSRGB colour
rgba <- newZeroRGBA
setRGBARed rgba red
setRGBAGreen rgba green
setRGBABlue rgba blue
setRGBAAlpha rgba 1
pure rgba

However, the Colour type doesn't actually have an associated alpha value, so we must use 1.

It would be more correct to use the AlphaColour throughout the Termonad codebase instead of Colour.

This would be a relatively simple change. You'd basically just have to change all the uses of Colour to AlphaColour in https://github.com/cdepillabout/termonad/blob/3776e6392dd0a613f6b9e3ea85b85fe97815f685/src/Termonad/Config/Colour.hs, and then fix all the type errors.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions