Comments (10)
The library currently doesn't work because of some compiler bugs:
vlang/v#16473
vlang/v#16496
I am waiting for those to be resolved, then it should work in theory
from color.v.
Also, will fix this asap
from color.v.
Yes, there is such a problem. But there are a few more errors in the library and one in the example.
C:/Users/zerg17/.vmodules/rgbcube/color/src/paintbrush.v:25:13: error: undefined ident: `disabled`
23 | bg: p.bg
24 | styles: p.styles
25 | disabled: disabled
| ~~~~~~~~
26 | }
27 | }
Solution: Fix line 25 in the "paintbrush.v" from "disabled: disabled" to "disabled: p.disabled"
C:/prog/v/v_test/main.v:6:5: error: unknown field `style` in struct literal of type `rgbcube.color.BrushParams`.
Did you mean `styles`?
4 | fg: color.rgb(0, 0, 0)
5 | bg: color.hex(0xffffff)
6 | style: [color.bold, color.underline, color.italic]
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
7 | )
Solution: correct the name of the structure field in the example
C:/Users/zerg17/.vmodules/rgbcube/color/src/paintbrush.v:33:9: error: cannot take the address of rgbcube.color.new_brush(p)
31 |
32 | pub fn new_brush_pointer(p BrushParams) &Brush {
33 | return &new_brush(p)
| ^
34 | }
35 |
I don't know how to fix it
from color.v.
Good find 🤔 Weird that the last one is invalid. Fixed in ##66 (not the last one though, will see)
from color.v.
Should be fixed in d820ca3
from color.v.
The error has changed, but it's still in the same place. Why is it necessary to use a pointer there?
C:/Users/zerg17/.vmodules/rgbcube/color/src/paintbrush.v:33:10: notice: interface field `rgbcube.color.BrushImpl.fg` must be initialized
31 |
32 | pub fn new_brush_pointer(p BrushParams) &Brush {
33 | return &BrushImpl{
| ~~~~~~~~~~
34 | ...new_brush(p)
35 | }
from color.v.
hmm, weird, also it needs a pointer since the method will return a pointer
from color.v.
i think i can't do this as new brush returns an interface
from color.v.
In the example from the documentation, an array of interfaces is created and pointers are not used. I don't see the point in them. https://github.com/vlang/v/blob/master/doc/docs.md#interfaces
from color.v.
Oh, i forgot to make the render method use a pointer, could you PR that? and bump the version
from color.v.
Related Issues (1)
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 color.v.