Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Color and Vector typos/consistency changes #127

Open
corlick98 opened this issue Mar 20, 2021 · 1 comment
Open

Color and Vector typos/consistency changes #127

corlick98 opened this issue Mar 20, 2021 · 1 comment

Comments

@corlick98
Copy link
Contributor

I went through most pages of the API and wrote down any "issues" I could see. I talked to benjamin_dobell and he said I should make a couple issues here instead of pull requests to avoid merge conflicts.

/color

  • “Vector and Color are the first classes to be defined in pure Lua. This means you have to use colon operator”: is this still true? Color.setAt(col, “g”, 1) works
  • Color.fromHex: I believe this should fix the issue where alpha is not optional and then this can be re-added to the api. For now could just say alpha is required.

/color/#colorblue

  • Is the 2 return values still true? I tried the example and name was nil

/color#dump

  • Is the 2 return values still true? I tried the example and I couldn’t replicate

/color/#colorlist

  • Using => instead of = may be misleading (unless this is syntax I am unaware of)

/color/#coloradd

  • Info box says dump instead of Add

/vector

  • “Vector and Color are the first classes to be defined in pure Lua. This means you have to use colon operator”: is this still true?

/vector#methods-summary

  • Should self in the info box link to types.md or should the return values in the table not link since types.md doesn’t say anything about self or should all selfs link to the box that explains self?

/vector#methods-not-modifying-self

  • OrthoNormalize: guranteed -> guaranteed

/vector/#element-access-details

  • setAt/set: Should the return tags use self instead of vector?

/vector/#methods-details

  • all functions: "and returning self" -> "and returns self"
  • sub: info box “to subtracts” -> “to subtract from self”
  • scale: info box “The vector to scale”->”The vector to scale by” or something to make it more clear otherVec won't be changed.
  • project: info box “The normal vector.” This is not the normal vector that would be perpendicular and the projection would always be 0.

/vector/#methods-not-modifying-self-details

  • equals: based on this the default margin is actually 0.001 which makes the example make more sense as currently it is by making the margin smaller they are considered equal.
  • string: is the 2 return values still true I can’t replicate it with the examples
  • lerp: The value returned is (b-a)*t+a not (b-a)*t
  • orthoNormalize: in description it says binormalPlaner in info box it says binormalPlanar
@ikegami
Copy link

ikegami commented Apr 17, 2021

“Vector and Color are the first classes to be defined in pure Lua. This means you have to use colon operator”: is this still true? Color.setAt(col, “g”, 1) works

The correct usage is c:setAtt("g", 1), which is short for c.setAtt(c, "g", 1), not Color.setAtt(c, "g", 1).

Now, if you assume c.setAtt == Color.setAtt, then you can get away with using Color.setAtt(c, "g", 1). But that relies on assumptions about the internals of both Color and of Color objects. Even though the assumptions are currently true, you should not do that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants