Forcing coloring in lines?!

I was just exploring games when I cam across this…


And became flawed at how they were able to achieve coloring within the lines??

How is this possible?
Having text buttons would just overlap each over, can’t do custom shapes on them either. You couldn’t store all the line pixels in data. Even the bucket fill I’m completely stumped how any of this is achieved.

Any thoughts?

2 Likes

It looks like the editable image is being filled using a BFS-like algorithm(by slightly latency ).

2 Likes

I was unaware that EditableImage was public now, but I guess the last time I looked at it was when it was in beta a few years ago.

Actually, you can, and if you create an EditableImage from a texture using AssetService::CreateEditableImageAsync then it’s already stored for you and can be retreived with EditableImage::ReadPixelsBuffer.

local AssetService = game:GetService("AssetService")
local editable = AssetService:CreateEditableImageAsync("rbxassetid://1234")
local image_label = ... 
image_label.ImageContent = Content.fromObject(editable)

Could be BFS, iterative DFS, and a number of other things, but I suspect the latency is because they are making individual write buffer calls for every pixel. They might simply have a bad implementation of the algorithm they’re using, but we don’t have access to the code to know that.