Comments (6)
I think it's a simple implementation (on branch alpha
), and is only necessary where alpha
is a single value, since
colour_values(1:5, alpha = seq(0, 0.8, length.out = 5))
'just works' too.
However, what should colour_values(x, 1.0001)
return? Is this example a too nuanced edge-case?
from colourvalues.
@MichaelChirico If I were to implement this, should I change the accepted values of alpha from [0,255] to [1,256], so that it's more obvious that anything in [0,1] will be treated as a percentage?
from colourvalues.
@SymbolixAU I think no... only 1
is ambiguous since 0
is the same for both interpretations. And I think 0
should be 0
, not 1
...
Will come back to this again when I'm off vacation...
from colourvalues.
I've merged this into master in this commit, so now alpha is
optional. Single value in [0,255] applied to all colours, or a decimal in [0, 1) (to indicate a percentage, noting 1 is excluded), or a vector of numeric values the same length as x. The numeric vector will be scaled into the range [0,255]. If a matrix palette is supplied this argument is ignored.
I'm still not entirely 100% sure about this... and I don't know why...
from colourvalues.
Hopefully this is a case of the beauty of dynamically-typed languages... 😬
from colourvalues.
from colourvalues.
Related Issues (20)
- extra control for breaks? - as in image() HOT 5
- get_palette() - return hex HOT 3
- IntegerVector vs NumericVector
- color_values() modifying global environment? HOT 3
- update to cardinal_cubic_b_spline.hpp
- normalise colours
- remove Boost HOT 2
- size_t -> R_xlen_t
- interleaved RGBA vector
- remove local interpolation .hpp file
- support interleave
- List input - n_summaries
- include_alpha = FALSE still returns alpha for NA values HOT 4
- validate na_colour hex input
- interleaved - matrix palettes HOT 1
- ASAN memory leak HOT 2
- Issue generating colors for some palettes HOT 5
- integer64 support
- templates
- Compatibility with older versions of boost HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from colourvalues.