Skip to content

Alpha channel is getting applied twice when drawing to imagematrix #335

@groovy9

Description

@groovy9

New to Luxor, I'm doing the following to draw a small blue box and output the top left pixel value. With the blue channel set to 1 and alpha set to 0.5, I expect the pixel I output to have 1.0 blue channel and 0.5 alpha but I'm getting 0.5 for the blue channel, which is effectively doubling the alpha channel effect.

Is there something I'm misunderstanding about how this should work?

using Luxor, Colors, Images

function test()
    w, h = (10, 10)
    m = @imagematrix! zeros(UInt32, h, w) begin
        setcolor((0.0, 0.0, 1.0, 0.5))
        box(Point(0, 0), w, h, :fill)
    end w h
    println(m[1, 1])
end

test()

Ouput:

ARGB32(0.0N0f8, 0.0N0f8, 0.502N0f8, 0.502N0f8)

Expected output:

ARGB32(0.0N0f8, 0.0N0f8, 1.0N0f8, 0.502N0f8)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions