{{ message }}
added color customization#188
Merged
Merged
Conversation
The coders are able to set the tracer’s colors to anything they want! Since I use the style background color attribute on the div it can accept a wide variety of values for the background color. I first wanted to pass in some color value when calling notify or select but then I realized there is a lot of issues with the amount of parameters . So I thought of doing some sort of global set like the HTML canvas/context does. Tracer now has 5 new methods for setting the colors. _Set(name)FillColor(color_goes_here). The logic of the setting fillColor and it being displayed should be similar to the canvas/context fillStyle setting. It will keep using that color until the color is switched again. I had to change the clear method inside array2d.js also to handle the new coloring change.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

The coders are able to set the tracer’s colors to anything they want!
Since I use the style background color attribute on the div it can
accept a wide variety of values for the background color.
I first wanted to pass in some color value when calling notify or
select but then I realized there is a lot of issues with the amount of
parameters. So I thought of doing some sort of global set like the
HTML canvas/context does.
Tracer now has 5 new methods for setting the colors.
_set(name)FillColor(color_goes_here).
Valid color formats (must be passed in as strings):
The logic of setting/using the fillColor methods should be similar to the canvas/context fillStyle. It will keep using that color until the color is switched again.
Example:
tracer._select( j )._wait(); // default background colortracer._setSelectFillColor('orange') // will be orange until changedtracer._select( k )._wait(); // orange background colorI had to change the clear method inside array2d.js also to handle the
new coloring change.