fix(lines): use sRGB colors
This commit is contained in:
@@ -83,7 +83,12 @@ impl Lines {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn set_points_flex(node: &Node, _calling_client: Arc<Client>, data: &[u8]) -> Result<()> {
|
pub fn set_points_flex(node: &Node, _calling_client: Arc<Client>, data: &[u8]) -> Result<()> {
|
||||||
let points: Vec<LinePointRaw> = deserialize(data)?;
|
let mut points: Vec<LinePointRaw> = deserialize(data)?;
|
||||||
|
for p in &mut points {
|
||||||
|
p.color[0] = p.color[0].powf(2.2);
|
||||||
|
p.color[1] = p.color[1].powf(2.2);
|
||||||
|
p.color[2] = p.color[2].powf(2.2);
|
||||||
|
}
|
||||||
node.lines.get().unwrap().data.lock().points = points;
|
node.lines.get().unwrap().data.lock().points = points;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
@@ -113,11 +118,17 @@ pub fn create_flex(_node: &Node, calling_client: Arc<Client>, data: &[u8]) -> Re
|
|||||||
points: Vec<LinePointRaw>,
|
points: Vec<LinePointRaw>,
|
||||||
cyclic: bool,
|
cyclic: bool,
|
||||||
}
|
}
|
||||||
let info: CreateTextInfo = deserialize(data)?;
|
let mut info: CreateTextInfo = deserialize(data)?;
|
||||||
let node = Node::create(&calling_client, "/drawable/lines", info.name, true);
|
let node = Node::create(&calling_client, "/drawable/lines", info.name, true);
|
||||||
let parent = find_spatial_parent(&calling_client, info.parent_path)?;
|
let parent = find_spatial_parent(&calling_client, info.parent_path)?;
|
||||||
let transform = parse_transform(info.transform, true, true, true)?;
|
let transform = parse_transform(info.transform, true, true, true)?;
|
||||||
|
|
||||||
|
for p in &mut info.points {
|
||||||
|
p.color[0] = p.color[0].powf(2.2);
|
||||||
|
p.color[1] = p.color[1].powf(2.2);
|
||||||
|
p.color[2] = p.color[2].powf(2.2);
|
||||||
|
}
|
||||||
|
|
||||||
let node = node.add_to_scenegraph();
|
let node = node.add_to_scenegraph();
|
||||||
Spatial::add_to(&node, Some(parent), transform, false)?;
|
Spatial::add_to(&node, Some(parent), transform, false)?;
|
||||||
Lines::add_to(&node, info.points, info.cyclic)?;
|
Lines::add_to(&node, info.points, info.cyclic)?;
|
||||||
|
|||||||
Reference in New Issue
Block a user