Code Monkey home page Code Monkey logo

Comments (10)

RGBCube avatar RGBCube commented on July 19, 2024

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.

RGBCube avatar RGBCube commented on July 19, 2024

Also, will fix this asap

from color.v.

Zerg17 avatar Zerg17 commented on July 19, 2024

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.

RGBCube avatar RGBCube commented on July 19, 2024

Good find 🤔 Weird that the last one is invalid. Fixed in ##66 (not the last one though, will see)

from color.v.

RGBCube avatar RGBCube commented on July 19, 2024

Should be fixed in d820ca3

from color.v.

Zerg17 avatar Zerg17 commented on July 19, 2024

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.

RGBCube avatar RGBCube commented on July 19, 2024

hmm, weird, also it needs a pointer since the method will return a pointer

from color.v.

RGBCube avatar RGBCube commented on July 19, 2024

i think i can't do this as new brush returns an interface

from color.v.

Zerg17 avatar Zerg17 commented on July 19, 2024

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.

RGBCube avatar RGBCube commented on July 19, 2024

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 photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.