-
Notifications
You must be signed in to change notification settings - Fork 47
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
Add cross-sectional charts and some examples to docs #406
Conversation
julia> parse(Colorant, HSL(1, 1, 1)) | ||
HSL{Float32}(1.0f0,1.0f0,1.0f0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand the intent of this example. I don't think this example is worth the documentation. However, this behavior is probably not what the users expect, so I included the example which passes a color instance to the second argument, as a warning.
Edit: Perhaps this may be a remnant of the old color()
. 👻
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed.
You can convert colors to hexadecimal strings using the [`hex`](@ref) function. | ||
Note that the conversion result does not have the prefix `"#"`. | ||
|
||
```jldoctest example | ||
julia> color = colorant"#C0FFEE" | ||
RGB{N0f8}(0.753,1.0,0.933) | ||
|
||
julia> hex(color) | ||
"C0FFEE" | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The hex
had been documented only with a docstring, so I mentioned it a bit. I think hex
and parse
should be paired.
Codecov Report
@@ Coverage Diff @@
## master #406 +/- ##
=======================================
Coverage 80.38% 80.38%
=======================================
Files 11 11
Lines 877 877
=======================================
Hits 705 705
Misses 172 172 Continue to review full report at Codecov.
|
154b4a1
to
68524c5
Compare
julia> using Colors; #hide | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was not hidden.:sweat_smile:
68524c5
to
45d5ea0
Compare
45d5ea0
to
d23f650
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks fantastic!
julia> parse(Colorant, HSL(1, 1, 1)) | ||
HSL{Float32}(1.0f0,1.0f0,1.0f0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed.
If you feel the charts are too small, please use the zoom function of your browser.:sweat_smile: |
u16(x) = (u8((x & 0xFFFF)>>8); u8(x)) | ||
u32(x) = (u16((x & 0xFFFFFFFF)>>16); u16(x)) | ||
b(bstr) = write(buf, bstr) | ||
function pallet(c::Color) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
palette...
This adds the cross-sectional charts previewed in #398 (comment).
Although there is discussion about the axis assignment (cf. #398 (comment)), but in this PR, it is as I originally defined. Since I am currently modifying the conversion codes for
HSV
,HSL
, andHSI
, I just want a way to visually check the S-V, S-L and S-I planes. (Edit: see: #407)In addition, this PR changes some documents.