Git Product home page Git Product logo

crayon's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

crayon's Issues

old syntax and strconv.atoi() Option return type

Can't use this module cause of this

/home/teris/.vmodules/thecodrr/crayon/colors.v:67:28: warning: `fn f(x, y Type)` syntax has been deprecated and will soon be removed. Use `fn f(x Type, y Type)` instead. You can run `v fmt -w "/home/teris/.vmodules/thecodrr/crayon/colors.v"` to automatically fix your code.
   65 | }
   66 | 
   67 | pub fn (c &Crayon) bg_rgb(r, g, b int) &Crayon {
      |                            ^
   68 |     rgb := r.str() + ";" + g.str() + ";" + b.str()
   69 |     mut crayon := c
/home/teris/.vmodules/thecodrr/crayon/colors.v:67:31: warning: `fn f(x, y Type)` syntax has been deprecated and will soon be removed. Use `fn f(x Type, y Type)` instead. You can run `v fmt -w "/home/teris/.vmodules/thecodrr/crayon/colors.v"` to automatically fix your code.
   65 | }
   66 | 
   67 | pub fn (c &Crayon) bg_rgb(r, g, b int) &Crayon {
      |                               ^
   68 |     rgb := r.str() + ";" + g.str() + ";" + b.str()
   69 |     mut crayon := c
/home/teris/.vmodules/thecodrr/crayon/colors.v:139:25: warning: `fn f(x, y Type)` syntax has been deprecated and will soon be removed. Use `fn f(x Type, y Type)` instead. You can run `v fmt -w "/home/teris/.vmodules/thecodrr/crayon/colors.v"` to automatically fix your code.
  137 | }
  138 | 
  139 | pub fn (c &Crayon) rgb(r, g, b int) &Crayon {
      |                         ^
  140 |     rgb := r.str() + ";" + g.str() + ";" + b.str()
  141 |     mut crayon := c
/home/teris/.vmodules/thecodrr/crayon/colors.v:139:28: warning: `fn f(x, y Type)` syntax has been deprecated and will soon be removed. Use `fn f(x Type, y Type)` instead. You can run `v fmt -w "/home/teris/.vmodules/thecodrr/crayon/colors.v"` to automatically fix your code.
  137 | }
  138 | 
  139 | pub fn (c &Crayon) rgb(r, g, b int) &Crayon {
      |                            ^
  140 |     rgb := r.str() + ";" + g.str() + ";" + b.str()
  141 |     mut crayon := c
/home/teris/.vmodules/thecodrr/crayon/crayon.v:23:27: error: cannot use `[]string` as `string` in argument 1 to `arr`
   21 |         println("Your terminal does not support colors. Please use a terminal that supports escape sequences for the best experience.")
   22 |     }
   23 |     return &Crayon{text: arr(texts)}
      |                              ~~~~~
   24 | }
   25 |
/home/teris/.vmodules/thecodrr/crayon/crayon.v:91:22: error: cannot use `[]string` as `string` in argument 1 to `arr`
   89 | pub fn (c &Crayon) print_with(texts ...string) {
   90 |     if texts.len > 0 {
   91 |         text_joined := arr(texts).join(" ")
      |                            ~~~~~
   92 |         println(c.str() + " " + text_joined)
   93 |     } else {
/home/teris/.vmodules/thecodrr/crayon/parser.v:68:15: error: strconv.atoi() returns an option but is missing an `or {}` block
   66 |         return -1,-1,-1
   67 |     }
   68 |     r := strconv.atoi(clrs[0])
      |                  ~~~~~~~~~~~~~
   69 |     g := strconv.atoi(clrs[1])
   70 |     b := strconv.atoi(clrs[2])
/home/teris/.vmodules/thecodrr/crayon/parser.v:69:15: error: strconv.atoi() returns an option but is missing an `or {}` block
   67 |     }
   68 |     r := strconv.atoi(clrs[0])
   69 |     g := strconv.atoi(clrs[1])
      |                  ~~~~~~~~~~~~~
   70 |     b := strconv.atoi(clrs[2])
   71 |     return r,g,b
/home/teris/.vmodules/thecodrr/crayon/parser.v:70:15: error: strconv.atoi() returns an option but is missing an `or {}` block
   68 |     r := strconv.atoi(clrs[0])
   69 |     g := strconv.atoi(clrs[1])
   70 |     b := strconv.atoi(clrs[2])
      |                  ~~~~~~~~~~~~~
   71 |     return r,g,b
   72 | }

cannot use type `?int` as type `int` in second argument to `index_after()`

/home/xander/.vmodules/thecodrr/crayon/crayon.v:118:48: cannot use type `?int` as type `int` in second argument to `index_after()`
  116| pub fn strip_text(text string) string{
  117| 	start_index := text.index("\e[")
  118| 	end_index := text.index_after("m", start_index) + 1
             	                                        ^
  119| 
  120| 	if start_index >= 0 && end_index >= 0 {

notice print form module

when i import the module it print this.

notice: use `mut array2 := array1.clone()` instead of `mut array2 := array1` (or use `unsafe`)
  16 |
  17 | fn (c Crayon) stylize(s string) Crayon {
  18 |     mut stl := c.style
     |             ~~
  19 |     stl << style[s].str()
  20 |     return Crayon{

win 11
vscode

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.