# Library acess some core function and other not

**URL:** <https://discourse.processing.org/t/library-acess-some-core-function-and-other-not/16077>\
**Category:** Beginners\
**Created:** [December 3, 2019, 1:35pm UTC](https://discourse.processing.org/t/library-acess-some-core-function-and-other-not/16077 "2019-12-03T13:35:07Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![matheplica](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/matheplica/32/21035_2.png) [@matheplica](https://discourse.processing.org/u/matheplica)\
**Post date:** [December 3, 2019, 1:35pm UTC](https://discourse.processing.org/t/library-acess-some-core-function-and-other-not/16077/1 "2019-12-03T13:35:07Z")

</div>

I, I’m trying to create my own library and it’s not so easy.  
The small class I create don’t recognize the “color” type even he is in processing.core.

```auto
public class Triangle {
	color[] colors = new color[3];}

```

The function `sh = createShape();` is not recognize and `noStroke(); triangle()` also.

The triangle class begin with `package minimap; import processing.core.*;`  
Here’s an expert in the place ?

---

<div class="post-metadata">

**Author:** ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)\
**Post date:** [December 3, 2019, 1:43pm UTC](https://discourse.processing.org/t/library-acess-some-core-function-and-other-not/16077/2 "2019-12-03T13:43:11Z")

</div>

> [@matheplica](#):
>
> … don’t recognize the “color” type even if it is in “processing.core”.

Function **color()** exists in Processing’s API:

1. [PApplet](http://Processing.GitHub.io/processing-javadocs/core/processing/core/PApplet.html#color-float-float-float-float-)
2. [PGraphics](http://Processing.GitHub.io/processing-javadocs/core/processing/core/PGraphics.html#color-float-float-float-float-)

But Processing’s primitive datatype `color` is the same as Java’s `int`.

---

<div class="post-metadata">

**Author:** ![matheplica](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/matheplica/32/21035_2.png) [@matheplica](https://discourse.processing.org/u/matheplica)\
**Post date:** [December 3, 2019, 1:49pm UTC](https://discourse.processing.org/t/library-acess-some-core-function-and-other-not/16077/3 "2019-12-03T13:49:58Z")

</div>

I agree, ofCourse. But eclipse bug on these lines. How to access all processing function in my lib ?

---

<div class="post-metadata">

**Author:** ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)\
**Post date:** [December 3, 2019, 2:00pm UTC](https://discourse.processing.org/t/library-acess-some-core-function-and-other-not/16077/4 "2019-12-03T14:00:14Z")

</div>

Java programming outside the PDE is pretty much like having “.java” file tabs on the PDE: ☕

> <https://gist.github.com/GoToLoop/ea4db8a8622e27541213da3c9a43ca21>

  

> <https://gist.github.com/GoToLoop/bba0c288aaeeb5ef9bb1>

  

> <https://gist.github.com/GoToLoop/1d1eb18f468a7d5758469707276b6ea1>

---

<div class="post-metadata">

**Author:** ![matheplica](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/matheplica/32/21035_2.png) [@matheplica](https://discourse.processing.org/u/matheplica)\
**Post date:** [December 3, 2019, 2:06pm UTC](https://discourse.processing.org/t/library-acess-some-core-function-and-other-not/16077/5 "2019-12-03T14:06:32Z")

</div>

Sorry, I don’t understand.  
I think it’s an eclipse configuration mistake because I can use PVector but not color and there are both in processing.core.

---

<div class="post-metadata">

**Author:** ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)\
**Post date:** [December 7, 2019, 1:07am UTC](https://discourse.processing.org/t/library-acess-some-core-function-and-other-not/16077/6 "2019-12-07T01:07:23Z")

</div>

> [@matheplica](#):
>
> I can use PVector but not color and there are both in processing.core.

Not in the same way. PVector is defined in Processing’s library API – however `color` as a datatype is a keyword handled by the preprocessor that turns pde files into java files before executing them. It does this:

1. finds the word “color” used as a datatype
2. replaces it with `int`

If you are writing java, then you aren’t running your code through the preprocessor. This means:

1. you have to write “public” or “private” – the preprocessor wont add them for you
2. you have to use “int” – the preprocessor won’t change `color` into `int` for you.
3. et cetera
