Help us understand the problem. What is going on with this article?

P5.js 日本語リファレンス(lightness)

このページでは「P5.js 日本語リファレンス」 の lightness関数を説明します。

lightness()

説明文

指定した色からHSL明度値を取得します。

構文

lightness(color)

パラメタ

  • color
    p5.Color | Number[ ] | String:p5.Colorオブジェクト、カラーコンポーネント、CSSカラー

戻り値

Number:HSL明度値

function draw() {
  colorMode(HSL);
  let c = color(156, 100, 50, 1); // 緑色を設定
  fill(c);
  rect(15, 20, 35, 60);
  let value = lightness(c); // HSL明度値50を取得します
  fill(value);
  rect(50, 20, 35, 60);
}

実行結果

lightness.JPG

著作権

p5.js was created by Lauren McCarthy and is developed by a community of collaborators, with support from the Processing Foundation and NYU ITP. Identity and graphic design by Jerel Johnson.

ライセンス

Creative Commons(CC BY-NC-SA 4.0) に従います。

bit0101
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした