Comments (7)
Random colors for individual pixels are not available at the moment. As for random shapes, you can do it the same way as for deprecated one:
class RandomPixelShape(
private val from : List<QrVectorShapeModifier>
) : QrVectorPixelShape {
override fun createPath(size: Float, neighbors: Neighbors): Path {
return from.random().createPath(size, neighbors)
}
}
shapes {
darkPixel = RandomPixelShape(
listOf(
QrVectorPixelShape.Circle(.3f),
QrVectorPixelShape.Circle(.5f),
QrVectorPixelShape.Circle(.7f),
)
)
}
from custom-qr-generator.
Thanks, this worked! I now wanted to try to make random solid colors (3 slightly different variations).
I tried to make it similar like your example above, but for some reason always one color is chosen randomly for the whole QR code instead of the pixels.
Does CreatePaint not get executed for every pixel?
from custom-qr-generator.
Random colors for individual pixels are not available at the moment.
Well...
Does CreatePaint not get executed for every pixel?
All pixels are combined to a single path before applying a paint so you can make them gradient
from custom-qr-generator.
Ok, thanks, so it is not possible with the vector method. Damn.
Thanks for your help anyway.
from custom-qr-generator.
Will be possible after #35.
You can test it now in a com.github.alexzhirkevich:custom-qr-generator:separate_painting-SNAPSHOT
snapshot and give a feedback
from custom-qr-generator.
Thanks, that one was fast!
I am looking forward to the next release!
from custom-qr-generator.
Available in 2.0.0-alpha01
from custom-qr-generator.
Related Issues (20)
- QrVectorLogo is not correctly showed HOT 2
- java.lang.IllegalArgumentException: width and height must be > 0 HOT 6
- com.google.zxing.WriterException HOT 5
- Add QrVectorPixelShape.Square(size) shape modifier HOT 3
- How to use your library draw QR codes with 3 vertices and circles? Looking forward to your reply HOT 5
- Support the different standard encodings HOT 7
- Expose reserved areas HOT 15
- Customizing QR code after generation HOT 4
- Is the size of the positioning markings adjustable? HOT 4
- How to remove icon and background after choose them HOT 2
- How to custom gradient color and select background, logo from devices HOT 6
- Highlight anchor elements for better recognition seems break in Library version 2.0.0-alpha01 HOT 8
- add jetpack compose support to the library HOT 5
- Any Java samples? HOT 3
- Generated QR not scan-able HOT 6
- I run the app module of this project, and input "123" ,but it can't be scanned by other qr scanner. HOT 4
- [BUG] Documentation and Source Code is not published
- Publish apks on GitHub HOT 2
- [BUG] The code in example is invalid
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 custom-qr-generator.