Skip to content
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

kwarg change #52

Merged
merged 1 commit into from
Jan 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ The `foreground` and `background` argument can be of three types:
These colors are supported by almost all terminals.
* An `Integer` between 0 and 255.
This will use the 256 color ANSI escape codes.
To see what number corresponds to what color and if your terminal supports 256 colors, use `Crayons.test_256_colors(shownumbers::Bool=true)`.
To see what number corresponds to what color and if your terminal supports 256 colors, use `Crayons.test_256_colors(codes=true)`.
* A `Tuple` of three `Integer`s, all between 0 and 255.
This will be interpreted as a `(r, g, b)` 24 bit color.
To test your terminals support for 24 bit colors, use `Crayons.test_24bit_colors(shownumbers::Bool=false)`.
To test your terminals support for 24 bit colors, use `Crayons.test_24bit_colors(codes=false)`.
The support for this is currently quite limited but is being improved in terminals continuously, see [here](https://gist.github.com/XVilka/8346728).
* A `UInt32` representing a color given in hexadecimal format.
Will be converted to the corresponding RGB format.
Expand Down
4 changes: 2 additions & 2 deletions src/test_prints.jl
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function test_system_colors(io::IO = stdout)
end
end

test_256_colors(codes::Bool = true) = test_256_colors(stdout, codes)
test_256_colors(; codes::Bool = true) = test_256_colors(stdout, codes)
test_256_colors(io::IO) = test_256_colors(io, true)
function test_256_colors(io::IO, codes::Bool)
println(io, "System colors (0..15):")
Expand Down Expand Up @@ -48,7 +48,7 @@ function test_256_colors(io::IO, codes::Bool)
end
end

test_24bit_colors(codes::Bool = true) = test_24bit_colors(stdout, codes)
test_24bit_colors(; codes::Bool = true) = test_24bit_colors(stdout, codes)
test_24bit_colors(io::IO) = test_24bit_colors(io, true)
function test_24bit_colors(io::IO, codes::Bool)
steps = 0:30:255
Expand Down