Skip to content

The colour argument passed to Draw.Square is ignored #21

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
DavidBetteridge opened this issue Jul 18, 2018 · 2 comments
Open

The colour argument passed to Draw.Square is ignored #21

DavidBetteridge opened this issue Jul 18, 2018 · 2 comments
Assignees

Comments

@DavidBetteridge
Copy link
Contributor

Each call to Draw.Square(Colours.Green) is done in a different colour

@henryallsuch
Copy link
Collaborator

Ok will take a look!

@henryallsuch
Copy link
Collaborator

If an invalid valid is passed, it defaults to a random colour. I have made a colour method which takes a colour name from any html colour name: https://en.wikipedia.org/wiki/Web_colors#HTML_color_names

Colour.withName("seagreen");

I have updated the default example:

https://github.com/yorkdayofcode/yorkdayofcode.github.io/blob/master/index.html

We can add back in some const for a syntax sugar??

i.e.:
Colours.Green = function(){
return Colour.withName("seagreen");
}

Although that might introduce confusion when people try access one that doesn't exist.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants