![](https://watataku-artist-katsuyaku.com/wp-content/uploads/2024/03/watataku-hukidashi-light-blue.png)
今回の記事の目的はProcessingの「hex()
」を理解し、自分なりに使ってみること。
この記事を書いた人
![](https://watataku-artist-katsuyaku.com/wp-content/uploads/2024/03/watataku-user-profile-illustrationi-light-blue.png)
![](https://watataku-artist-katsuyaku.com/wp-content/uploads/2024/03/watataku-user-profile-illustrationi-light-blue.png)
- クリエイティブコーディングで制作した作品と、上達のためにやったこと・学習過程を発信
- コンセプトは「クリエイティブコーディング1万時間の歩き方」
- 2024年にProcessingの構文のアウトプットを終え、2025年から作品制作開始(クリエイティブコーディングで作成した作品集)
目次
【Processing】hex()について
hex()について
- 英語のhexは、「16進数(hexadecimal)」の略
- hex()は整数(int)、バイト(byte)、文字(char)、または色(color)を16進数表記を含む文字列(String)に変換するために使う
【Processing】hex()の使い方【画像とコード】
![【Processing】hex()の使い方【画像とコード】](https://watataku-artist-katsuyaku.com/wp-content/uploads/2024/11/processing-hex-converting-integers-and-more-to-hexadecimal-string1.png)
![【Processing】hex()の使い方【画像とコード】](https://watataku-artist-katsuyaku.com/wp-content/uploads/2024/11/processing-hex-converting-integers-and-more-to-hexadecimal-string1.png)
int number = 255; // 変数numberを整数値255で初期化
String hexString = hex(number); // numberを16進数表記に変換し、変数hexStringに代入
println(hexString); // hexStringの内容("FF")をコンソールに出力
【Processing】hex()を使ってみた感想
hex()
は16進数を知りたいときに便利。
![](https://watataku-artist-katsuyaku.com/wp-content/uploads/2024/03/watataku-hukidashi-light-blue.png)
![](https://watataku-artist-katsuyaku.com/wp-content/uploads/2024/03/watataku-hukidashi-light-blue.png)
![](https://watataku-artist-katsuyaku.com/wp-content/uploads/2024/03/watataku-hukidashi-light-blue.png)
それでは今日もレッツワクワクコーディング。