# Accessing processing data types from class of java package

**URL:** <https://discourse.processing.org/t/accessing-processing-data-types-from-class-of-java-package/27028>\
**Category:** Beginners\
**Created:** [January 13, 2021, 3:32pm UTC](https://discourse.processing.org/t/accessing-processing-data-types-from-class-of-java-package/27028 "2021-01-13T15:32:35Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![bhavya](https://avatars.discourse-cdn.com/v4/letter/b/aca169/32.png) [@bhavya](https://discourse.processing.org/u/bhavya)\
**Post date:** [January 13, 2021, 3:32pm UTC](https://discourse.processing.org/t/accessing-processing-data-types-from-class-of-java-package/27028/1 "2021-01-13T15:32:35Z")

</div>

I have learnt processing from The Coding Train. Recently I was working on some GUI functionality (i.e. Button, Slider, etc.) and thought to create a library. I know there are GUI library already exist, but I am doing for learning.  
So I started to create a library in Eclipse by following The Coding Train’s video about same. I want to use processing data type color which is not part of java. I don’t know how to access such data types from core.jar. I have a confession, I don’t know much about java so if I’m asking something wrong, I am sorry.  
Thank you.

---

<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:** [January 13, 2021, 4:07pm UTC](https://discourse.processing.org/t/accessing-processing-data-types-from-class-of-java-package/27028/2 "2021-01-13T16:07:47Z")

</div>

> [@bhavya](#):
>
> I want to use Processing data type `color` which is not part of Java.

Processing’s `color` datatype is merely an alias to Java’s `int` primitive datatype. 😉

Processing’s hash `#` symbol like in #D000A0 is the same as Java’s `0xff`: 0xffD000A0. 🎨

---

<div class="post-metadata">

**Author:** ![bhavya](https://avatars.discourse-cdn.com/v4/letter/b/aca169/32.png) [@bhavya](https://discourse.processing.org/u/bhavya)\
**Post date:** [January 13, 2021, 5:14pm UTC](https://discourse.processing.org/t/accessing-processing-data-types-from-class-of-java-package/27028/3 "2021-01-13T17:14:01Z")

</div>

I want a class variable for color of button, so what data type I need to define.

---

<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:** [January 13, 2021, 5:25pm UTC](https://discourse.processing.org/t/accessing-processing-data-types-from-class-of-java-package/27028/4 "2021-01-13T17:25:21Z")

</div>

Just have an `int` field inside that class:

```auto
public class MyColor {
  public int c;

  public MyColor(final int cc) {
    c = cc;
  }
}

```

For a finer-grain control you can use Java’s bundled class Color:  
[docs.Oracle.com/en/java/javase/11/docs/api/java.desktop/java/awt/Color.html](http://docs.Oracle.com/en/java/javase/11/docs/api/java.desktop/java/awt/Color.html)
