Welcome to mirror list, hosted at ThFree Co, Russian Federation.

node_separate_color.osl « shaders « osl « kernel « cycles « intern - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: cba2d85da05c08c57fc4a5b3fa937d8f16023ea0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
/* SPDX-License-Identifier: Apache-2.0
 * Copyright 2011-2022 Blender Foundation */

#include "node_color.h"
#include "stdcycles.h"

shader node_separate_color(string color_type = "rgb",
                         color Color = 0.8,
                         output float Red = 0.0,
                         output float Green = 0.0,
                         output float Blue = 0.0)
{
  color col;
  if (color_type == "rgb")
    col = Color;
  else if (color_type == "hsv")
    col = rgb_to_hsv(Color);
  else if (color_type == "hsl")
    col = rgb_to_hsl(Color);
  else
    warning("%s", "Unknown color space!");

  Red = col[0];
  Green = col[1];
  Blue = col[2];
}